You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/02/13 01:14:32 UTC
[25/37] git commit: [flex-asjs] [refs/heads/spark] - copy of many
flex-sdk classes,
modified to try to compile on top of the FlexJS base classes. A COMPILE::LATER
flag is used to comment out features like multi-swf support and a few other
features that
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
new file mode 100644
index 0000000..a66b83e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerImpl.as
@@ -0,0 +1,1034 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.InteractiveObject;
+import flash.display.Sprite;
+import flash.events.ContextMenuEvent;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+import flash.events.IOErrorEvent;
+import flash.events.MouseEvent;
+import flash.events.ProgressEvent;
+import flash.geom.Point;
+import flash.text.TextField;
+import flash.text.TextFieldType;
+import flash.ui.Mouse;
+import mx.core.FlexGlobals;
+import org.apache.flex.core.UIBase;
+import mx.core.mx_internal;
+import mx.core.ISystemCursorClient;
+import mx.core.IUIComponent;
+import mx.events.Request;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+import mx.core.IFlexModuleFactory;
+
+use namespace mx_internal;
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public class CursorManagerImpl extends EventDispatcher implements ICursorManager
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static var instance:ICursorManager;
+
+ /**
+ * @private
+ *
+ * Place to hook in additional classes
+ */
+ public static var mixins:Array;
+
+ //--------------------------------------------------------------------------
+ //
+ // Class methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public static function getInstance():ICursorManager
+ {
+ if (!instance)
+ instance = new CursorManagerImpl();
+
+ return instance;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public function CursorManagerImpl(systemManager:ISystemManager = null)
+ {
+ super();
+
+ if (instance && !systemManager)
+ throw new Error("Instance already exists.");
+
+ if (systemManager)
+ this.systemManager = systemManager as ISystemManager;
+ else
+ this.systemManager = SystemManagerGlobals.topLevelSystemManagers[0] as ISystemManager;
+
+ if (mixins)
+ {
+ var n:int = mixins.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ new mixins[i](this);
+
+ }
+ }
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private var nextCursorID:int = 1;
+
+ /**
+ * @private
+ */
+ private var cursorList:Array = [];
+
+ /**
+ * @private
+ */
+ private var busyCursorList:Array = [];
+
+ /**
+ * @private
+ */
+ mx_internal var initialized:Boolean = false;
+
+ /**
+ * @private
+ */
+ mx_internal var cursorHolder:Sprite;
+
+ /**
+ * @private
+ */
+ private var currentCursor:DisplayObject;
+
+ /**
+ * @private
+ */
+ private var listenForContextMenu:Boolean = false;
+
+ /*******************************************************************
+ * Regarding overTextField, showSystemCursor, and showCustomCursor:
+ * Don't modify or read these variables unless you are certain
+ * you will not create race conditions. E.g. you may get the
+ * wrong (or no) cursor, and get stuck in an inconsistent state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+
+ /**
+ * @private
+ */
+ private var overTextField:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var overLink:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var showSystemCursor:Boolean = false;
+
+ /**
+ * @private
+ */
+ private var showCustomCursor:Boolean = false;
+
+ /**
+ * @private
+ *
+ * State variable -- set when there is a custom cursor and the
+ * mouse has left the stage. Upon return, mouseMoveHandler will
+ * restore the custom cursor and remove the system cursor.
+ */
+ private var customCursorLeftStage:Boolean = false;
+
+ /*******************************************************************/
+
+ /**
+ * @private
+ */
+ mx_internal var systemManager:ISystemManager = null;
+
+ /**
+ * @private
+ */
+ mx_internal var sandboxRoot:IEventDispatcher = null;
+
+ /**
+ * @private
+ */
+ private var sourceArray:Array = [];
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // currentCursorID
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorID:int = 0 /* CursorManager.NO_CURSOR */;
+
+ /**
+ * ID of the current custom cursor,
+ * or CursorManager.NO_CURSOR if the system cursor is showing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorID():int
+ {
+ return _currentCursorID;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorID(value:int):void
+ {
+ _currentCursorID = value;
+
+ if (hasEventListener("currentCursorID"))
+ dispatchEvent(new Event("currentCursorID"));
+ }
+
+ //----------------------------------
+ // currentCursorXOffset
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorXOffset:Number = 0;
+
+ /**
+ * The x offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorXOffset():Number
+ {
+ return _currentCursorXOffset;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorXOffset(value:Number):void
+ {
+ _currentCursorXOffset = value;
+
+ if (hasEventListener("currentCursorXOffset"))
+ dispatchEvent(new Event("currentCursorXOffset"));
+ }
+
+ //----------------------------------
+ // currentCursorYOffset
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ mx_internal var _currentCursorYOffset:Number = 0;
+
+ /**
+ * The y offset of the custom cursor, in pixels,
+ * relative to the mouse pointer.
+ *
+ * @default 0
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get currentCursorYOffset():Number
+ {
+ return _currentCursorYOffset;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentCursorYOffset(value:Number):void
+ {
+ _currentCursorYOffset = value;
+
+ if (hasEventListener("currentCursorYOffset"))
+ dispatchEvent(new Event("currentCursorYOffset"));
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Makes the cursor visible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>showCursor()</code> method
+ * always shows the cursor regardless of how many calls
+ * to the <code>hideCursor()</code> method were made.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function showCursor():void
+ {
+ if (cursorHolder)
+ cursorHolder.visible = true;
+
+ if (hasEventListener("showCursor"))
+ dispatchEvent(new Event("showCursor"));
+ }
+
+ /**
+ * Makes the cursor invisible.
+ * Cursor visibility is not reference-counted.
+ * A single call to the <code>hideCursor()</code> method
+ * always hides the cursor regardless of how many calls
+ * to the <code>showCursor()</code> method were made.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function hideCursor():void
+ {
+ if (cursorHolder)
+ cursorHolder.visible = false;
+
+ if (hasEventListener("hideCursor"))
+ dispatchEvent(new Event("hideCursor"));
+
+ }
+
+ /**
+ * Creates a new cursor and sets an optional priority for the cursor.
+ * Adds the new cursor to the cursor list.
+ *
+ * @param cursorClass Class of the cursor to display.
+ *
+ * @param priority Integer that specifies
+ * the priority level of the cursor.
+ * Possible values are <code>CursorManagerPriority.HIGH</code>,
+ * <code>CursorManagerPriority.MEDIUM</code>, and <code>CursorManagerPriority.LOW</code>.
+ *
+ * @param xOffset Number that specifies the x offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param yOffset Number that specifies the y offset
+ * of the cursor, in pixels, relative to the mouse pointer.
+ *
+ * @param setter The IUIComponent that set the cursor. Necessary (in multi-window environments)
+ * to know which window needs to display the cursor.
+ *
+ * @return The ID of the cursor.
+ *
+ * @see mx.managers.CursorManagerPriority
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setCursor(cursorClass:Class, priority:int = 2,
+ xOffset:Number = 0,
+ yOffset:Number = 0):int
+ {
+ if (hasEventListener("setCursor"))
+ {
+ var event:Request = new Request("setCursor", false, true);
+ event.value = [ cursorClass, priority, xOffset, yOffset ];
+ if (!dispatchEvent(event))
+ {
+ return event.value as int;
+ }
+ }
+
+ var cursorID:int = nextCursorID++;
+
+ // Create a new CursorQueueItem.
+ var item:CursorQueueItem = new CursorQueueItem();
+ item.cursorID = cursorID;
+ item.cursorClass = cursorClass;
+ item.priority = priority;
+ item.x = xOffset;
+ item.y = yOffset;
+ if (systemManager)
+ item.systemManager = systemManager;
+ else
+ item.systemManager = FlexGlobals.topLevelApplication.systemManager;
+
+ // Push it onto the cursor list.
+ cursorList.push(item);
+
+ // Re-sort the cursor list based on priority level.
+ cursorList.sort(priorityCompare);
+
+ // Determine which cursor to display
+ showCurrentCursor();
+
+ return cursorID;
+ }
+
+ /**
+ * @private
+ */
+ private function priorityCompare(a:CursorQueueItem, b:CursorQueueItem):int
+ {
+ if (a.priority < b.priority)
+ return -1;
+ else if (a.priority == b.priority)
+ return 0;
+
+ return 1;
+ }
+
+ /**
+ * Removes a cursor from the cursor list.
+ * If the cursor being removed is the currently displayed cursor,
+ * the CursorManager displays the next cursor in the list, if one exists.
+ * If the list becomes empty, the CursorManager displays
+ * the default system cursor.
+ *
+ * @param cursorID ID of cursor to remove.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeCursor(cursorID:int):void
+ {
+ if (hasEventListener("removeCursor"))
+ if (!dispatchEvent(new Request("removeCursor", false, true, cursorID)))
+ return;
+
+ for (var i:Object in cursorList)
+ {
+ var item:CursorQueueItem = cursorList[i];
+ if (item.cursorID == cursorID)
+ {
+ // Remove the element from the array.
+ cursorList.splice(i, 1);
+
+ // Determine which cursor to display.
+ showCurrentCursor();
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * Removes all of the cursors from the cursor list
+ * and restores the system cursor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeAllCursors():void
+ {
+ if (hasEventListener("removeAllCursors"))
+ if (!dispatchEvent(new Event("removeAllCursors", false, true)))
+ return;
+
+ cursorList.splice(0);
+
+ showCurrentCursor();
+ }
+
+ /**
+ * Displays the busy cursor.
+ * The busy cursor has a priority of CursorManagerPriority.LOW.
+ * Therefore, if the cursor list contains a cursor
+ * with a higher priority, the busy cursor is not displayed
+ * until you remove the higher priority cursor.
+ * To create a busy cursor at a higher priority level,
+ * use the <code>setCursor()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setBusyCursor():void
+ {
+ if (hasEventListener("setBusyCursor"))
+ if (!dispatchEvent(new Event("setBusyCursor", false, true)))
+ return;
+
+ var cursorManagerStyleDeclaration:CSSStyleDeclaration =
+ StyleManager.getStyleManager(systemManager as IFlexModuleFactory).
+ getMergedStyleDeclaration("mx.managers.CursorManager");
+
+ var busyCursorClass:Class =
+ cursorManagerStyleDeclaration.getStyle("busyCursor");
+
+ busyCursorList.push(setCursor(busyCursorClass, CursorManagerPriority.LOW));
+ }
+
+ /**
+ * Removes the busy cursor from the cursor list.
+ * If other busy cursor requests are still active in the cursor list,
+ * which means you called the <code>setBusyCursor()</code> method more than once,
+ * a busy cursor does not disappear until you remove
+ * all busy cursors from the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function removeBusyCursor():void
+ {
+ if (hasEventListener("removeBusyCursor"))
+ if (!dispatchEvent(new Event("removeBusyCursor", false, true)))
+ return;
+
+ if (busyCursorList.length > 0)
+ removeCursor(int(busyCursorList.pop()));
+ }
+
+ /**
+ * @private
+ * Decides what cursor to display.
+ */
+ private function showCurrentCursor():void
+ {
+ // if there are custom cursors...
+ if (cursorList.length > 0)
+ {
+ if (!initialized)
+ {
+ initialized = true;
+
+ var e:Event;
+ if (hasEventListener("initialize"))
+ {
+ e = new Event("initialize", false, true);
+ }
+ if (!e || dispatchEvent(e))
+ {
+ // The first time a cursor is requested of the CursorManager,
+ // create a Sprite to hold the cursor symbol
+ cursorHolder = new UIBase();
+ cursorHolder.name = "cursorHolder";
+ cursorHolder.mouseEnabled = false;
+ cursorHolder.mouseChildren = false;
+ systemManager.cursorChildren.addChild(cursorHolder);
+ }
+ }
+
+ // Get the top most cursor.
+ var item:CursorQueueItem = cursorList[0];
+
+ // If the system cursor was being displayed, hide it.
+ if (currentCursorID == CursorManager.NO_CURSOR)
+ Mouse.hide();
+
+ // If the current cursor has changed...
+ if (item.cursorID != currentCursorID)
+ {
+ if (cursorHolder.numChildren > 0)
+ cursorHolder.removeChildAt(0);
+
+ currentCursor = new item.cursorClass();
+
+ if (currentCursor)
+ {
+ if (currentCursor is InteractiveObject)
+ InteractiveObject(currentCursor).mouseEnabled = false;
+ if (currentCursor is DisplayObjectContainer)
+ DisplayObjectContainer(currentCursor).mouseChildren = false;
+ cursorHolder.addChild(currentCursor);
+
+ addContextMenuHandlers();
+
+ var pt:Point;
+ // make sure systemManager is not other implementation of ISystemManager
+ if (systemManager is SystemManager)
+ {
+ pt = new Point(SystemManager(systemManager).mouseX + item.x, SystemManager(systemManager).mouseY + item.y);
+ pt = SystemManager(systemManager).localToGlobal(pt);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ cursorHolder.x = pt.x;
+ cursorHolder.y = pt.y;
+ }
+ // WindowedSystemManager
+ else if (systemManager is DisplayObject)
+ {
+ pt = new Point(DisplayObject(systemManager).mouseX + item.x, DisplayObject(systemManager).mouseY + item.y);
+ pt = DisplayObject(systemManager).localToGlobal(pt);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ cursorHolder.x = DisplayObject(systemManager).mouseX + item.x;
+ cursorHolder.y = DisplayObject(systemManager).mouseY + item.y;
+ }
+ // otherwise
+ else
+ {
+ cursorHolder.x = item.x;
+ cursorHolder.y = item.y;
+ }
+
+ COMPILE::LATER
+ {
+ var e2:Event;
+ if (hasEventListener("addMouseMoveListener"))
+ e2 = new Event("addMouseMoveListener", false, true);
+ if (!e2 || dispatchEvent(e2))
+ systemManager.stage.addEventListener(MouseEvent.MOUSE_MOVE,
+ mouseMoveHandler,true,EventPriority.CURSOR_MANAGEMENT);
+
+ var e3:Event;
+ if (hasEventListener("addMouseOutListener"))
+ e3 = new Event("addMouseOutListener", false, true);
+ if (!e3 || dispatchEvent(e3))
+ systemManager.stage.addEventListener(MouseEvent.MOUSE_OUT,
+ mouseOutHandler,true,EventPriority.CURSOR_MANAGEMENT);
+ }
+ }
+
+ currentCursorID = item.cursorID;
+ currentCursorXOffset = item.x;
+ currentCursorYOffset = item.y;
+ }
+ }
+ else
+ {
+ showCustomCursor = false;
+
+ if (currentCursorID != CursorManager.NO_CURSOR)
+ {
+ // There is no cursor in the cursor list to display,
+ // so cleanup and restore the system cursor.
+ currentCursorID = CursorManager.NO_CURSOR;
+ currentCursorXOffset = 0;
+ currentCursorYOffset = 0;
+
+ COMPILE::LATER
+ {
+ var e4:Event;
+ if (hasEventListener("removeMouseMoveListener"))
+ e4 = new Event("removeMouseMoveListener", false, true)
+ if (!e4 || dispatchEvent(e4))
+ {
+ systemManager.stage.removeEventListener(MouseEvent.MOUSE_MOVE,
+ mouseMoveHandler,true);
+ }
+
+ var e5:Event;
+ if (hasEventListener("removeMouseMoveListener"))
+ e5 = new Event("removeMouseOutListener", false, true)
+ if (!e5 || dispatchEvent(e5))
+ {
+ systemManager.stage.removeEventListener(MouseEvent.MOUSE_OUT,
+ mouseOutHandler,true);
+ }
+ }
+ cursorHolder.removeChild(currentCursor);
+
+ removeContextMenuHandlers();
+ }
+ Mouse.show();
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function addContextMenuHandlers():void
+ {
+ if (!listenForContextMenu)
+ {
+ const app:InteractiveObject = systemManager.document as InteractiveObject;
+ const sm:InteractiveObject = systemManager as InteractiveObject;
+
+ COMPILE::LATER
+ {
+ if (app && app.contextMenu)
+ {
+ app.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler,
+ true, EventPriority.CURSOR_MANAGEMENT);
+ listenForContextMenu = true;
+ }
+
+ if (sm && sm.contextMenu)
+ {
+ sm.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler,
+ true, EventPriority.CURSOR_MANAGEMENT);
+ listenForContextMenu = true;
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function removeContextMenuHandlers():void
+ {
+ if (listenForContextMenu)
+ {
+ const app:InteractiveObject = systemManager.document as InteractiveObject;
+ const sm:InteractiveObject = systemManager as InteractiveObject;
+
+ if (app && app.contextMenu)
+ app.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
+
+ if (sm && sm.contextMenu)
+ sm.contextMenu.removeEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelectHandler, true);
+
+ listenForContextMenu = false;
+ }
+ }
+
+ /**
+ * @private
+ * Called by other components if they want to display
+ * the busy cursor during progress events.
+ */
+ public function registerToUseBusyCursor(source:Object):void
+ {
+ if (hasEventListener("registerToUseBusyCursor"))
+ if (!dispatchEvent(new Request("registerToUseBusyCursor", false, true, source)))
+ return;
+
+ if (source && source is EventDispatcher)
+ {
+ source.addEventListener(ProgressEvent.PROGRESS, progressHandler);
+ source.addEventListener(Event.COMPLETE, completeHandler);
+ source.addEventListener(IOErrorEvent.IO_ERROR, completeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Called by other components to unregister
+ * a busy cursor from the progress events.
+ */
+ public function unRegisterToUseBusyCursor(source:Object):void
+ {
+ if (hasEventListener("unRegisterToUseBusyCursor"))
+ if (!dispatchEvent(new Request("unRegisterToUseBusyCursor", false, true, source)))
+ return;
+
+ if (source && source is EventDispatcher)
+ {
+ source.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
+ source.removeEventListener(Event.COMPLETE, completeHandler);
+ source.removeEventListener(IOErrorEvent.IO_ERROR, completeHandler);
+ }
+ }
+
+ /**
+ * @private
+ * Called when contextMenu is opened
+ */
+ private function contextMenu_menuSelectHandler(event:ContextMenuEvent):void
+ {
+ showCustomCursor = true; // Restore the custom cursor
+ // Standalone player doesn't initially send mouseMove when the contextMenu is closed,
+ // so we need to listen for mouseOver as well.
+ sandboxRoot.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+ }
+
+ /**
+ * @private
+ */
+ private function mouseOverHandler(event:MouseEvent):void
+ {
+ sandboxRoot.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+ mouseMoveHandler(event);
+ }
+
+ /**
+ * @private
+ */
+ private function findSource(target:Object):int
+ {
+ var n:int = sourceArray.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (sourceArray[i] === target)
+ return i;
+ }
+ return -1;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Event handlers
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ *
+ * Handles the mouse leaving the stage; hides the custom cursor and restores the system cursor.
+ */
+ mx_internal function mouseOutHandler(event:MouseEvent):void
+ {
+ // relatedObject==null implies the mouse left the stage.
+ // this also fires when you are returning from a context menu click.
+ //
+ // it sometimes fires after you drag off the stage, and back to the stage quickly,
+ // and let go of the button -- this seems like a player bug
+ if ((event.relatedObject == null) && (cursorList.length > 0))
+ {
+ //trace("mouseOutHandler", event);
+
+ // this will get unset in mouseMoveHandler (since that fires when
+ // the mouse returns/glides over the stage)
+ customCursorLeftStage = true;
+ hideCursor();
+ Mouse.show();
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function mouseMoveHandler(event:MouseEvent):void
+ {
+
+ var pt:Point = new Point(event.stageX, event.stageY);
+ pt = cursorHolder.parent.globalToLocal(pt);
+ pt.x += currentCursorXOffset;
+ pt.y += currentCursorYOffset;
+ cursorHolder.x = pt.x;
+ cursorHolder.y = pt.y;
+
+ var target:Object = event.target;
+
+ var isInputTextField:Boolean =
+ (target is TextField && target.type == TextFieldType.INPUT) ||
+ (target is ISystemCursorClient &&
+ ISystemCursorClient(target).showSystemCursor);
+
+ // Do target test.
+ if (!overTextField && isInputTextField)
+ {
+ overTextField = true;
+ showSystemCursor = true;
+ }
+ else if (overTextField && !isInputTextField)
+ {
+ overTextField = false;
+ showCustomCursor = true;
+ }
+ else
+ {
+ showCustomCursor = true
+ }
+
+ // Handle switching between system and custom cursor.
+ if (showSystemCursor)
+ {
+ showSystemCursor = false;
+ cursorHolder.visible = false;
+ Mouse.show();
+ }
+ if (showCustomCursor)
+ {
+ showCustomCursor = false;
+ cursorHolder.visible = true;
+ Mouse.hide();
+
+ if (hasEventListener("showCustomCursor"))
+ dispatchEvent(new Event("showCustomCursor"));
+ }
+ }
+
+ /**
+ * @private
+ * Displays the busy cursor if a component is in a busy state.
+ */
+ private function progressHandler(event:ProgressEvent):void
+ {
+ // Only pay attention to the first progress call. Ignore all others.
+ var sourceIndex:int = findSource(event.target);
+ if (sourceIndex == -1)
+ {
+ // Add the target to the list of objects we are listening for.
+ sourceArray.push(event.target);
+
+ setBusyCursor();
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function completeHandler(event:Event):void
+ {
+ var sourceIndex:int = findSource(event.target);
+ if (sourceIndex != -1)
+ {
+ // Remove from the list of targets we are listening to.
+ sourceArray.splice(sourceIndex, 1);
+
+ removeBusyCursor();
+ }
+ }
+
+}
+
+}
+
+import mx.managers.CursorManager;
+import mx.managers.CursorManagerPriority;
+import mx.managers.ISystemManager;
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Helper class: CursorQueueItem
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * @private
+ */
+class CursorQueueItem
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function CursorQueueItem()
+ {
+ super();
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ public var cursorID:int = CursorManager.NO_CURSOR;
+
+ /**
+ * @private
+ */
+ public var cursorClass:Class = null;
+
+ /**
+ * @private
+ */
+ public var priority:int = CursorManagerPriority.MEDIUM;
+
+ /**
+ * @private
+ */
+ public var systemManager:ISystemManager;
+
+ /**
+ * @private
+ */
+ public var x:Number;
+
+ /**
+ * @private
+ */
+ public var y:Number;
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
new file mode 100644
index 0000000..43bfd1a
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/CursorManagerPriority.as
@@ -0,0 +1,79 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+/**
+ * The CursorManagerPriority class defines the constant values for the
+ * <code>priority</code> argument to the
+ * <code>CursorManager.setCursor()</code> method.
+ *
+ * @see mx.managers.CursorManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public final class CursorManagerPriority
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constant that specifies the highest cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const HIGH:int = 1;
+
+ /**
+ * Constant that specifies a medium cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const MEDIUM:int = 2;
+
+ /**
+ * Constant that specifies the lowest cursor priority when passed
+ * as the <code>priority</code> argument to <code>setCursor()</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public static const LOW:int = 3;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
new file mode 100644
index 0000000..4594de1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ICursorManager.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+[ExcludeClass]
+
+/**
+ * @private
+ */
+public interface ICursorManager
+{
+ function get currentCursorID():int;
+ function set currentCursorID(value:int):void;
+ function get currentCursorXOffset():Number
+ function set currentCursorXOffset(value:Number):void;
+ function get currentCursorYOffset():Number
+ function set currentCursorYOffset(value:Number):void;
+
+ function showCursor():void;
+ function hideCursor():void;
+ function setCursor(cursorClass:Class, priority:int = 2,
+ xOffset:Number = 0, yOffset:Number = 0):int;
+ function removeCursor(cursorID:int):void;
+ function removeAllCursors():void;
+ function setBusyCursor():void;
+ function removeBusyCursor():void;
+
+ function registerToUseBusyCursor(source:Object):void;
+ function unRegisterToUseBusyCursor(source:Object):void;
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as
new file mode 100644
index 0000000..33dab83
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManager.as
@@ -0,0 +1,300 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import org.apache.flex.core.IUIBase;
+import org.apache.flex.events.IEventDispatcher;
+//import flash.display.InteractiveObject;
+import flash.display.Sprite;
+import mx.core.IButton;
+
+/**
+ * The IFocusManager interface defines the interface that components must implement
+ * to manage the focus on components in response to mouse activity or
+ * keyboard activity (Tab key), and to support a default button.
+ *
+ * @see mx.managers.FocusManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManager extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // defaultButton
+ //----------------------------------
+
+ /**
+ * A reference to the original default Button control.
+ * Pressing the Enter key while the focus is on any control
+ * activates the Button control by dispatching a <code>click</code> event
+ * on the Button control, just as if it was clicked with the mouse.
+ * The actual default Button control changes if focus is given to another
+ * Button control, but switches back to the original if focus is not
+ * on a button.
+ *
+ * <p>This property is managed by Flex containers; do not set it directly
+ * to specify the default button.</p>
+ *
+ * <p>The <code>defaultButton</code> must be of class
+ * <code>mx.controls.Button</code> even though this property
+ * is of type <code>IUIComponent</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get defaultButton():IButton;
+
+ /**
+ * @private
+ */
+ function set defaultButton(value:IButton):void;
+
+ //----------------------------------
+ // defaultButtonEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the FocusManager should
+ * check for the Enter key being pressed to activate the default button.
+ * TextArea and other components that want to recognize
+ * the <code>Enter</code> key
+ * set this property to <code>false</code> to disable the Enter
+ * key from dispatching a <code>click</code> event on the
+ * default button, if it exists.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get defaultButtonEnabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set defaultButtonEnabled(value:Boolean):void;
+
+ //----------------------------------
+ // focusPane
+ //----------------------------------
+
+ /**
+ * A single Sprite that is moved from container to container
+ * as the focus moves to those containers.
+ * The Sprite is used as the parent of the visual indicator
+ * that a component has focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusPane():Sprite;
+
+ /**
+ * @private
+ */
+ function set focusPane(value:Sprite):void;
+
+ //----------------------------------
+ // nextTabIndex
+ //----------------------------------
+
+ /**
+ * The next unique tab index to use in this tab loop.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nextTabIndex():int;
+
+ //----------------------------------
+ // showFocusIndicator
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether to display an indicator that
+ * a component has focus.
+ * If <code>true</code> a component receiving focus
+ * draws a visible indicator that it has focus.
+ *
+ * <p>By default, this is <code>false</code> until the user uses
+ * the Tab key, then it is set to <code>true</code>.</p>
+ *
+ * <p>In general it is better to use
+ * the <code>showFocus()</code> and <code>hideFocus()</code> methods
+ * to change this property as those methods also update the
+ * visual indicator that a component has focus.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get showFocusIndicator():Boolean;
+
+ /**
+ * @private
+ */
+ function set showFocusIndicator(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the IFocusManagerComponent component that currently has the focus.
+ * Calling this method is recommended instead of using the Stage object
+ * because it indicates which component has focus.
+ * The Stage might return a subcomponent in that component.
+ *
+ * @return IFocusManagerComponent object that has focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getFocus():IFocusManagerComponent;
+
+ /**
+ * Sets focus to an IFocusManagerComponent component. Does not check for
+ * the components visibility, enabled state, or any other conditions.
+ *
+ * @param o A component that can receive focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setFocus(o:IFocusManagerComponent):void;
+
+ /**
+ * Sets <code>showFocusIndicator</code> to <code>true</code>
+ * and draws the visual focus indicator on the focused object, if any.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function showFocus():void;
+
+ /**
+ * Sets <code>showFocusIndicator</code> to <code>false</code>
+ * and removes the visual focus indicator from the focused object, if any.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function hideFocus():void;
+
+ /**
+ * The SystemManager activates and deactivates a FocusManager
+ * if more than one IFocusManagerContainer is visible at the same time.
+ * If the mouse is clicked in an IFocusManagerContainer with a deactivated
+ * FocusManager, the SystemManager will call
+ * the <code>activate()</code> method on that FocusManager.
+ * The FocusManager that was activated will have its <code>deactivate()</code> method
+ * called prior to the activation of another FocusManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function activate():void;
+
+ /**
+ * The SystemManager activates and deactivates a FocusManager
+ * if more than one IFocusManagerContainer is visible at the same time.
+ * If the mouse is clicked in an IFocusManagerContainer with a deactivated
+ * FocusManager, the SystemManager will call
+ * the <code>activate()</code> method on that FocusManager.
+ * The FocusManager that was activated will have its <code>deactivate()</code> method
+ * called prior to the activation of another FocusManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function deactivate():void;
+
+ /**
+ * Returns the IFocusManagerComponent that contains the given object, if any.
+ * Because the player can set focus to a subcomponent of a Flex component
+ * this method determines which IFocusManagerComponent has focus from
+ * the component perspective.
+ *
+ * @param o An object that can have player-level focus.
+ *
+ * @return The IFOcusManagerComponent containing <code>o</code> or
+ * <code>null</code>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function findFocusManagerComponent(o:IUIBase /* was InteractiveObject*/):IFocusManagerComponent;
+
+ /**
+ * Returns the IFocusManagerComponent that would receive focus
+ * if the user pressed the Tab key to navigate to another component.
+ * It will return the same component as the current focused component
+ * if there are no other valid components in the application.
+ *
+ * @param backward If <code>true</code>, return the object
+ * as if the Shift-Tab keys were pressed.
+ *
+ * @return The component that would receive focus.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getNextFocusManagerComponent(
+ backward:Boolean = false):IFocusManagerComponent;
+
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
new file mode 100644
index 0000000..20487e1
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerComponent.as
@@ -0,0 +1,193 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+/**
+ * The IFocusManagerComponent interface defines the interface
+ * that focusable components must implement in order to
+ * receive focus from the FocusManager.
+ * The base implementations of this interface are in the UIComponent class,
+ * but UIComponent does not implement the full IFocusManagerComponent interface
+ * since some UIComponents are not intended to receive focus.
+ * Therefore, to make a UIComponent-derived component be a valid focusable
+ * component, you simply add "implements IFocusManagerComponent" to the class
+ * definition.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManagerComponent
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // focusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the component can receive focus when selected.
+ *
+ * <p>As an optimization, if a child component in your component
+ * implements the IFocusManagerComponent interface, and you
+ * never want it to receive focus,
+ * you can set <code>focusEnabled</code>
+ * to <code>false</code> before calling <code>addChild()</code>
+ * on the child component.</p>
+ *
+ * <p>This will cause the FocusManager to ignore this component
+ * and not monitor it for changes to the <code>tabFocusEnabled</code>,
+ * <code>hasFocusableChildren</code>, and <code>mouseFocusEnabled</code> properties.
+ * This also means you cannot change this value after
+ * <code>addChild()</code> and expect the FocusManager to notice.</p>
+ *
+ * <p>Note: It does not mean that you cannot give this object focus
+ * programmatically in your <code>setFocus()</code> method;
+ * it just tells the FocusManager to ignore this IFocusManagerComponent
+ * component in the Tab and mouse searches.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusEnabled():Boolean;
+
+ /**
+ * @private
+ */
+ function set focusEnabled(value:Boolean):void;
+
+ //----------------------------------
+ // hasFocusableChildren
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#hasFocusableChildren
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get hasFocusableChildren():Boolean;
+
+ /**
+ * @private
+ */
+ function set hasFocusableChildren(value:Boolean):void;
+
+ //----------------------------------
+ // mouseFocusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the component can receive focus
+ * when selected with the mouse.
+ * If <code>false</code>, focus will be transferred to
+ * the first parent that is <code>mouseFocusEnabled</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get mouseFocusEnabled():Boolean;
+
+ //----------------------------------
+ // tabFocusEnabled
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether pressing the Tab key eventually
+ * moves focus to this component.
+ * Even if <code>false</code>, you can still be given focus
+ * by being selected with the mouse or via a call to
+ * <code>setFocus()</code>. This property replaces
+ * InteractiveObject.tabEnabled which must be set to true
+ * in Flex apps.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get tabFocusEnabled():Boolean;
+
+ //----------------------------------
+ // tabIndex
+ //----------------------------------
+
+ /**
+ * If <code>tabFocusEnabled</code>, the order in which the component receives focus.
+ * If -1, then the component receives focus based on z-order.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get tabIndex():int;
+
+ /**
+ * @private
+ */
+ function set tabIndex(value:int):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called by the FocusManager when the component receives focus.
+ * The component may in turn set focus to an internal component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setFocus():void;
+
+ /**
+ * Called by the FocusManager when the component receives focus.
+ * The component should draw or hide a graphic
+ * that indicates that the component has focus.
+ *
+ * @param isFocused If <code>true</code>, draw the focus indicator,
+ * otherwise hide it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function drawFocus(isFocused:Boolean):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as
new file mode 100644
index 0000000..9d96121
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/IFocusManagerContainer.as
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import flex.display.DisplayObject;
+import org.apache.flex.events.IEventDispatcher;
+import mx.core.IFlexDisplayObject;
+import mx.managers.IFocusManager;
+import mx.managers.ISystemManager;
+
+/**
+ * The IFocusManagerContainer interface defines the interface that
+ * containers implement to host a FocusManager.
+ * The PopUpManager automatically installs a FocusManager
+ * in any IFocusManagerContainer it pops up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IFocusManagerContainer extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // focusManager
+ //----------------------------------
+
+ /**
+ * The FocusManager for this component.
+ * The FocusManager must be in a <code>focusManager</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get focusManager():IFocusManager;
+
+ /**
+ * @private
+ */
+ function set focusManager(value:IFocusManager):void;
+
+ //----------------------------------
+ // defaultButton
+ //----------------------------------
+
+ /**
+ * The Button control designated as the default button
+ * for the container.
+ * When controls in the container have focus, pressing the
+ * Enter key is the same as clicking this Button control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ * @default null
+ */
+ function get defaultButton():IFlexDisplayObject;
+
+ /**
+ * @private
+ */
+ function set defaultButton(value:IFlexDisplayObject):void;
+
+ //----------------------------------
+ // systemManager
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#systemManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get systemManager():ISystemManager;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Determines whether the specified display object is a child
+ * of the container instance or the instance itself.
+ * The search includes the entire display list including this container instance.
+ * Grandchildren, great-grandchildren, and so on each return <code>true</code>.
+ *
+ * @param child The child object to test.
+ *
+ * @return <code>true</code> if the child object is a child of the container
+ * or the container itself; otherwise <code>false</code>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function contains(child:DisplayObject):Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
new file mode 100644
index 0000000..5df3910
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManager.as
@@ -0,0 +1,320 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import org.apache.flex.events.IEventDispatcher;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ * The LayoutManager is the engine behind
+ * Flex's measurement and layout strategy.
+ * Layout is performed in three phases; commit, measurement, and layout.
+ *
+ * <p>Each phase is distinct from the others and all UIComponents of
+ * one phase are processed prior to moving on to the next phase.
+ * During the processing of UIComponents in a phase, requests for
+ * UIComponents to get re-processed by some phase may occur.
+ * These requests are queued and are only processed
+ * during the next run of the phase.</p>
+ *
+ * <p>The <b>commit</b> phase begins with a call to
+ * <code>validateProperties()</code>, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateProperties()">
+ * <code>validateProperties()</code></a>method.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>This phase allows components whose contents depend on property
+ * settings to configure themselves prior to the measurement
+ * and the layout phases.
+ * For the sake of performance, sometimes a component's property setter
+ * method does not do all the work to update to the new property value.
+ * Instead, the property setter calls the <code>invalidateProperties()</code>
+ * method, deferring the work until this phase runs.
+ * This prevents unnecessary work if the property is set multiple times.</p>
+ *
+ * <p>The <b>measurement</b> phase begins with a call to
+ * <code>validateSize()</code>, which walks through a list
+ * (sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateSize()"><code>validateSize()</code></a>
+ * method to determine if the object has changed in size.</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> method was previously called,
+ * then the <code>validateSize()</code> method is called.
+ * If the size or position of the object was changed as a result of the
+ * <code>validateSize()</code> call, then the object's
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method is called, thus adding
+ * the object to the processing queue for the next run of the layout phase.
+ * Additionally, the object's parent is marked for both measurement
+ * and layout phases, by calling
+ * <a href="../core/UIComponent.html#invalidateSize()">
+ * <code>invalidateSize()</code></a> and
+ * <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> respectively.</p>
+ *
+ * <p>The objects in the list are processed by nesting order,
+ * with the <b>most</b> deeply nested object accessed first.
+ * This can also be referred to as bottom-up inside-out ordering.</p>
+ *
+ * <p>The <b>layout</b> phase begins with a call to the
+ * <code>validateDisplayList()</code> method, which walks through a list
+ * (reverse sorted by nesting level) of objects calling each object's
+ * <a href="../core/UIComponent.html#validateDisplayList()">
+ * <code>validateDisplayList()</code></a> method to request the object to size
+ * and position all components contained within it (i.e. its children).</p>
+ *
+ * <p>If an object's <a href="../core/UIComponent.html#invalidateDisplayList()">
+ * <code>invalidateDisplayList()</code></a> method was previously called,
+ * then <code>validateDisplayList()</code> method for the object is called.</p>
+ *
+ * <p>The objects in the list are processed in reversed nesting order,
+ * with the <b>least</b> deeply nested object accessed first.
+ * This can also be referred to as top-down or outside-in ordering.</p>
+ *
+ * <p>In general, components do not override the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or <code>validateDisplayList()</code> methods.
+ * In the case of UIComponents, most components override the
+ * <code>commitProperties()</code>, <code>measure()</code>, or
+ * <code>updateDisplayList()</code> methods, which are called
+ * by the <code>validateProperties()</code>,
+ * <code>validateSize()</code>, or
+ * <code>validateDisplayList()</code> methods, respectively.</p>
+ *
+ * <p>At application startup, a single instance of the LayoutManager is created
+ * and stored in the <code>UIComponent.layoutManager</code> property.
+ * All components are expected to use that instance.
+ * If you do not have access to the UIComponent object,
+ * you can also access the LayoutManager using the static
+ * <code>LayoutManager.getInstance()</code> method.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ILayoutManager extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // usePhasedInstantiation
+ //----------------------------------
+
+ /**
+ * A flag that indicates whether the LayoutManager allows screen updates
+ * between phases.
+ * If <code>true</code>, measurement and layout are done in phases, one phase
+ * per screen update.
+ * All components have their <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods
+ * called until all their properties are validated.
+ * The screen will then be updated.
+ *
+ * <p>Then all components will have their <code>validateSize()</code>
+ * and <code>measure()</code>
+ * methods called until all components have been measured, then the screen
+ * will be updated again. </p>
+ *
+ * <p>Finally, all components will have their
+ * <code>validateDisplayList()</code> and
+ * <code>updateDisplayList()</code> methods called until all components
+ * have been validated, and the screen will be updated again.
+ * If in the validation of one phase, an earlier phase gets invalidated,
+ * the LayoutManager starts over.
+ * This is more efficient when large numbers of components
+ * are being created an initialized. The framework is responsible for setting
+ * this property.</p>
+ *
+ * <p>If <code>false</code>, all three phases are completed before the screen is updated.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get usePhasedInstantiation():Boolean;
+
+ /**
+ * @private
+ */
+ function set usePhasedInstantiation(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Invalidation
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateProperties()</code> method called.
+ * A component should call this method when a property changes.
+ * Typically, a property setter method
+ * stores a the new value in a temporary variable and calls
+ * the <code>invalidateProperties()</code> method
+ * so that its <code>validateProperties()</code>
+ * and <code>commitProperties()</code> methods are called
+ * later, when the new value will actually be applied to the component and/or
+ * its children. The advantage of this strategy is that often, more than one
+ * property is changed at a time and the properties may interact with each
+ * other, or repeat some code as they are applied, or need to be applied in
+ * a specific order. This strategy allows the most efficient method of
+ * applying new property values.
+ *
+ * @param obj The object whose property changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateProperties(obj:ILayoutManagerClient ):void;
+
+ /**
+ * Adds an object to the list of components that want their
+ * <code>validateSize()</code> method called.
+ * Called when an object's size changes.
+ *
+ * <p>An object's size can change for two reasons:</p>
+ *
+ * <ol>
+ * <li>The content of the object changes. For example, the size of a
+ * button changes when its <code>label</code> is changed.</li>
+ * <li>A script explicitly changes one of the following properties:
+ * <code>minWidth</code>, <code>minHeight</code>,
+ * <code>explicitWidth</code>, <code>explicitHeight</code>,
+ * <code>maxWidth</code>, or <code>maxHeight</code>.</li>
+ * </ol>
+ *
+ * <p>When the first condition occurs, it's necessary to recalculate
+ * the measurements for the object.
+ * When the second occurs, it's not necessary to recalculate the
+ * measurements because the new size of the object is known.
+ * However, it's necessary to remeasure and relayout the object's
+ * parent.</p>
+ *
+ * @param obj The object whose size changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateSize(obj:ILayoutManagerClient ):void;
+
+ /**
+ * Called when a component changes in some way that its layout and/or visuals
+ * need to be changed.
+ * In that case, it is necessary to run the component's layout algorithm,
+ * even if the component's size hasn't changed. For example, when a new child component
+ * is added, or a style property changes or the component has been given
+ * a new size by its parent.
+ *
+ * @param obj The object that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function invalidateDisplayList(obj:ILayoutManagerClient ):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods: Commitment, measurement, layout, and drawing
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated. To
+ * guarantee that the values are updated, you can call the <code>validateNow()</code> method.
+ * It updates all properties in all components before returning.
+ * Call this method only when necessary as it is a computationally intensive call.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateNow():void;
+
+ /**
+ * When properties are changed, components generally do not apply those changes immediately.
+ * Instead the components usually call one of the LayoutManager's invalidate methods and
+ * apply the properties at a later time. The actual property you set can be read back
+ * immediately, but if the property affects other properties in the component or its
+ * children or parents, those other properties may not be immediately updated.
+ *
+ * <p>To guarantee that the values are updated,
+ * you can call the <code>validateClient()</code> method.
+ * It updates all properties in all components whose nest level is greater than or equal
+ * to the target component before returning.
+ * Call this method only when necessary as it is a computationally intensive call.</p>
+ *
+ * @param target The component passed in is used to test which components
+ * should be validated. All components contained by this component will have their
+ * <code>validateProperties()</code>, <code>commitProperties()</code>,
+ * <code>validateSize()</code>, <code>measure()</code>,
+ * <code>validateDisplayList()</code>,
+ * and <code>updateDisplayList()</code> methods called.
+ *
+ * @param skipDisplayList If <code>true</code>,
+ * does not call the <code>validateDisplayList()</code>
+ * and <code>updateDisplayList()</code> methods.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateClient(target:ILayoutManagerClient, skipDisplayList:Boolean = false):void;
+
+ /**
+ * Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @return Returns <code>true</code> if there are components that need validating;
+ * <code>false</code> if all components have been validated.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInvalid():Boolean;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
new file mode 100644
index 0000000..bf291b5
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/managers/ILayoutManagerClient.as
@@ -0,0 +1,211 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.managers
+{
+
+import flash.events.IEventDispatcher;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ * The ILayoutManagerClient interface defines the interface
+ * that a component must implement to participate in the
+ * LayoutManager's commit/measurement/layout sequence.
+ *
+ * <p>Objects that implement this interface can be passed to the
+ * LayoutManager's <code>invalidateProperties()</code> method.
+ * When the LayoutManager reaches the commit properties phase,
+ * the LayoutManager invokes this object's <code>validateProperties()</code>
+ * method.</p>
+ *
+ * <p>Similarly, if an object is passed to the LayoutManager's
+ * <code>invalidateSize()</code> method, then the LayoutManager
+ * calls that object's <code>validateSize()</code> method
+ * during its measurement phase, and if an object is passed
+ * to LayoutManager's <code>invalidateDisplayList()</code> method,
+ * then the LayoutManager calls its <code>validateDisplayList()</code> method
+ * during the layout phase.</p>
+ *
+ * <p>The ILayoutManagerClient interface is implemented by the UIComponent
+ * and ProgrammaticSkin classes.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ILayoutManagerClient extends IEventDispatcher
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // initialized
+ //----------------------------------
+
+ /**
+ * A flag that determines if an object has been through all three phases
+ * of layout validation (provided that any were required)
+ * This flag should only be modified by the LayoutManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get initialized():Boolean;
+
+ /**
+ * @private
+ */
+ function set initialized(value:Boolean):void;
+
+ //----------------------------------
+ // nestLevel
+ //----------------------------------
+
+ /**
+ * The top-level SystemManager has a nestLevel of 1.
+ * Its immediate children (the top-level Application and any pop-up
+ * windows) have a <code>nestLevel</code> of 2.
+ * Their children have a <code>nestLevel</code> of 3, and so on.
+ *
+ * The <code>nestLevel</code> is used to sort ILayoutManagerClients
+ * during the measurement and layout phases.
+ * During the commit phase, the LayoutManager commits properties on clients
+ * in order of increasing <code>nestLevel</code>, so that an object's
+ * children have already had their properties committed before Flex
+ * commits properties on the object itself.
+ * During the measurement phase, the LayoutManager measures clients
+ * in order of decreasing <code>nestLevel</code>, so that an object's
+ * children have already been measured before Flex measures
+ * the object itself.
+ * During the layout phase, the LayoutManager lays out clients
+ * in order of increasing <code>nestLevel</code>, so that an object
+ * has a chance to set the sizes of its children before the child
+ * objects are asked to position and size their children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nestLevel():int;
+
+ /**
+ * @private
+ */
+ function set nestLevel(value:int):void;
+
+ //----------------------------------
+ // processedDescriptors
+ //----------------------------------
+
+ /**
+ * @copy mx.core.UIComponent#processedDescriptors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get processedDescriptors():Boolean;
+
+ /**
+ * @private
+ */
+ function set processedDescriptors(value:Boolean):void;
+
+ //----------------------------------
+ // updateCompletePendingFlag
+ //----------------------------------
+
+ /**
+ * A flag that determines if an object is waiting to have its
+ * <code>updateComplete</code> event dispatched.
+ * This flag should only be modified by the LayoutManager.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get updateCompletePendingFlag():Boolean;
+
+ /**
+ * @private
+ */
+ function set updateCompletePendingFlag(value:Boolean):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Validates the properties of a component.
+ * If the <code>LayoutManager.invalidateProperties()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateProperties()</code> method
+ * is called when it's time to commit property values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateProperties():void;
+
+ /**
+ * Validates the measured size of the component
+ * If the <code>LayoutManager.invalidateSize()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateSize()</code> method
+ * is called when it's time to do measurements.
+ *
+ * @param recursive If <code>true</code>, call this method
+ * on the objects children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateSize(recursive:Boolean = false):void;
+
+ /**
+ * Validates the position and size of children and draws other
+ * visuals.
+ * If the <code>LayoutManager.invalidateDisplayList()</code> method is called with
+ * this ILayoutManagerClient, then the <code>validateDisplayList()</code> method
+ * is called when it's time to update the display list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function validateDisplayList():void;
+}
+
+}