Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1259748 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -0,0 +1,9126 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.GradientType;
+import flash.display.Graphics;
+import flash.display.InteractiveObject;
+import flash.display.Loader;
+import flash.display.Sprite;
+import flash.display.Stage;
+import flash.events.Event;
+import flash.events.EventPhase;
+import flash.events.FocusEvent;
+import flash.events.IEventDispatcher;
+import flash.events.KeyboardEvent;
+import flash.geom.Matrix;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.system.ApplicationDomain;
+import flash.text.TextLineMetrics;
+import flash.utils.getQualifiedClassName;
+import flash.utils.getQualifiedSuperclassName;
+
+import mx.automation.IAutomationObject;
+import mx.binding.BindingManager;
+import mx.controls.IFlexContextMenu;
+import mx.effects.EffectManager;
+import mx.effects.IEffect;
+import mx.effects.IEffectInstance;
+import mx.events.ChildExistenceChangedEvent;
+import mx.events.DragEvent;
+import mx.events.DynamicEvent;
+import mx.events.EffectEvent;
+import mx.events.FlexEvent;
+import mx.events.MoveEvent;
+import mx.events.PropertyChangeEvent;
+import mx.events.ResizeEvent;
+import mx.events.StateChangeEvent;
+import mx.events.ToolTipEvent;
+import mx.events.ValidationResultEvent;
+import mx.graphics.RoundedRectangle;
+import mx.managers.CursorManager;
+import mx.managers.ICursorManager;
+import mx.managers.IFocusManager;
+import mx.managers.IFocusManagerComponent;
+import mx.managers.IFocusManagerContainer;
+import mx.managers.ILayoutManagerClient;
+import mx.managers.ISystemManager;
+import mx.managers.IToolTipManagerClient;
+import mx.managers.SystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.managers.ToolTipManager;
+import mx.modules.ModuleManager;
+import mx.resources.IResourceManager;
+import mx.resources.ResourceManager;
+import mx.states.State;
+import mx.states.Transition;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager;
+import mx.styles.StyleProtoChain;
+import mx.utils.ColorUtil;
+import mx.utils.GraphicsUtil;
+import mx.utils.StringUtil;
+import mx.validators.IValidatorListener;
+import mx.validators.ValidationResult;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Lifecycle events
+//--------------------------------------
+
+/**
+ *  Dispatched when the component is added to a container as a content child
+ *  by using the addChild() or addChildAt() method.
+ *  If the component is added to the container as a noncontent child by
+ *  using the rawChildren.addChild() or
+ *  rawChildren.addChildAt() method, the event is not dispatched.
+ *
+ *  @eventType mx.events.FlexEvent.ADD
+ */
+[Event(name="add", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the component has finished its construction,
+ *  property processing, measuring, layout, and drawing.
+ *
+ *
At this point, depending on its visible property,
+ *  the component may not be visible even though it has been drawn.

+ *
+ *  @eventType mx.events.FlexEvent.CREATION_COMPLETE
+ */
+[Event(name="creationComplete", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when an object has had its commitProperties(),
+ *  measure(), and
+ *  updateDisplayList() methods called (if needed).
+ *
+ *
This is the last opportunity to alter the component before it is
+ *  displayed. All properties have been committed and the component has
+ *  been measured and layed out.

+ *
+ *  @eventType mx.events.FlexEvent.UPDATE_COMPLETE
+ */
+[Event(name="updateComplete", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when an object's state changes from visible to invisible.
+ *
+ *  @eventType mx.events.FlexEvent.HIDE
+ */
+[Event(name="hide", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the component has finished its construction
+ *  and has all initialization properties set.
+ *
+ *
After the initialization phase, properties are processed, the component
+ *  is measured, laid out, and drawn, after which the
+ *  creationComplete event is dispatched.

+ *
+ *  @eventType mx.events.FlexEvent.INITIALIZE
+ */
+[Event(name="initialize", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the object has moved.
+ *
+ *
You can move the component by setting the x
+ *  or y properties, by calling the move()
+ *  method, by setting one
+ *  of the following properties either on the component or on other
+ *  components such that the LayoutManager needs to change the
+ *  x or y properties of the component:

+ *
+ *

+ *
minWidth

+ *
minHeight

+ *
maxWidth

+ *
maxHeight

+ *
explicitWidth

+ *
explicitHeight

+ *

+ *
+ *
When you call the move() method, the move
+ *  event is dispatched before the method returns.
+ *  In all other situations, the move event is not dispatched
+ *  until after the property changes.

+ *
+ *  @eventType mx.events.MoveEvent.MOVE
+ */
+[Event(name="move", type="mx.events.MoveEvent")]
+
+/**
+ *  Dispatched at the beginning of the component initialization sequence.
+ *  The component is in a very raw state when this event is dispatched.
+ *  Many components, such as the Button control, create internal child
+ *  components to implement functionality; for example, the Button control
+ *  creates an internal UITextField component to represent its label text.
+ *  When Flex dispatches the preinitialize event,
+ *  the children, including the internal children, of a component
+ *  have not yet been created.
+ *
+ *  @eventType mx.events.FlexEvent.PREINITIALIZE
+ */
+[Event(name="preinitialize", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the component is removed from a container as a content child
+ *  by using the removeChild() or removeChildAt() method.
+ *  If the component is removed from the container as a noncontent child by
+ *  using the rawChildren.removeChild() or
+ *  rawChildren.removeChildAt() method, the event is not dispatched.
+ *
+ *  @eventType mx.events.FlexEvent.REMOVE
+ */
+[Event(name="remove", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the component is resized.
+ *
+ *
You can resize the component by setting the width or
+ *  height property, by calling the setActualSize()
+ *  method, or by setting one of
+ *  the following properties either on the component or on other components
+ *  such that the LayoutManager needs to change the width or
+ *  height properties of the component:

+ *
+ *

+ *
minWidth

+ *
minHeight

+ *
maxWidth

+ *
maxHeight

+ *
explicitWidth

+ *
explicitHeight

+ *

+ *
+ *
The resize event is not
+ *  dispatched until after the property changes.

+ *
+ *  @eventType mx.events.ResizeEvent.RESIZE
+ */
+[Event(name="resize", type="mx.events.ResizeEvent")]
+
+/**
+ *  Dispatched when an object's state changes from invisible to visible.
+ *
+ *  @eventType mx.events.FlexEvent.SHOW
+ */
+[Event(name="show", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Mouse events
+//--------------------------------------
+
+/**
+ *  Dispatched from a component opened using the PopUpManager
+ *  when the user clicks outside it.
+ *
+ *  @eventType mx.events.FlexMouseEvent.MOUSE_DOWN_OUTSIDE
+ */
+[Event(name="mouseDownOutside", type="mx.events.FlexMouseEvent")]
+
+/**
+ *  Dispatched from a component opened using the PopUpManager
+ *  when the user scrolls the mouse wheel outside it.
+ *
+ *  @eventType mx.events.FlexMouseEvent.MOUSE_WHEEL_OUTSIDE
+ */
+[Event(name="mouseWheelOutside", type="mx.events.FlexMouseEvent")]
+
+//--------------------------------------
+//  Validation events
+//--------------------------------------
+
+/**
+ *  Dispatched when values are changed programmatically
+ *  or by user interaction.
+ *
+ *
Because a programmatic change triggers this event, make sure
+ *  that any valueCommit event handler does not change
+ *  a value that causes another valueCommit event.
+ *  For example, do not change a control's dataProvider
+ *  property in a valueCommit event handler.

+ *
+ *  @eventType mx.events.FlexEvent.VALUE_COMMIT
+ */
+[Event(name="valueCommit", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when a component is monitored by a Validator
+ *  and the validation failed.
+ *
+ *  @eventType mx.events.FlexEvent.INVALID
+ */
+[Event(name="invalid", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when a component is monitored by a Validator
+ *  and the validation succeeded.
+ *
+ *  @eventType mx.events.FlexEvent.VALID
+ */
+[Event(name="valid", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Drag-and-drop events
+//--------------------------------------
+
+/**
+ *  Dispatched by a component when the user moves the mouse over the component
+ *  during a drag operation.
+ *  In an application running in Flash Player,
+ *  the event is dispatched many times when you move the mouse over any component.
+ *  In an application running in AIR, the event is dispatched only once.
+ *
+ *
In order to be a valid drop target, you must define a handler
+ *  for this event.
+ *  In the handler, you can change the appearance of the drop target
+ *  to provide visual feedback to the user that the component can accept
+ *  the drag.
+ *  For example, you could draw a border around the drop target,
+ *  or give focus to the drop target.

+ *
+ *
If you want to accept the drag, you must call the
+ *  DragManager.acceptDragDrop() method. If you don't
+ *  call acceptDragDrop(), you will not get any of the
+ *  other drag events.

+ *
+ *
In Flash Player, the value of the action property is always
+ *  DragManager.MOVE, even if you are doing a copy.
+ *  This is because the dragEnter event occurs before
+ *  the control recognizes that the Control key is pressed to signal a copy.
+ *  The action property of the event object for the
+ *  dragOver event does contain a value that signifies the type of
+ *  drag operation. You may change the type of drag action by calling the
+ *  DragManager.showFeedback() method.

+ *
+ *
In AIR, the default value of the action property is
+ *  DragManager.COPY.

+ *
+ *
Because of the way data to a Tree control is structured,
+ *  the Tree control handles drag and drop differently from the other list-based controls.
+ *  For the Tree control, the event handler for the dragDrop event
+ *  only performs an action when you move or copy data in the same Tree control,
+ *  or copy data to another Tree control.
+ *  If you drag data from one Tree control and drop it onto another Tree control
+ *  to move the data, the event handler for the dragComplete event
+ *  actually performs the work to add the data to the destination Tree control,
+ *  rather than the event handler for the dragDrop event,
+ *  and also removes the data from the source Tree control.
+ *  This is necessary because to reparent the data being moved,
+ *  Flex must remove it first from the source Tree control.

+ *
+ *  @see mx.managers.DragManager
+ *
+ *  @eventType mx.events.DragEvent.DRAG_ENTER
+ */
+[Event(name="dragEnter", type="mx.events.DragEvent")]
+
+/**
+ *  Dispatched by a component when the user moves the mouse while over the component
+ *  during a drag operation.
+ *  In Flash Player, the event is dispatched
+ *  when you drag an item over a valid drop target.
+ *  In AIR, the event is dispatched when you drag an item over
+ *  any component, even if the component is not a valid drop target.
+ *
+ *
In the handler, you can change the appearance of the drop target
+ *  to provide visual feedback to the user that the component can accept
+ *  the drag.
+ *  For example, you could draw a border around the drop target,
+ *  or give focus to the drop target.

+ *
+ *
You should handle this event to perform additional logic
+ *  before allowing the drop, such as dropping data to various locations
+ *  in the drop target, reading keyboard input to determine if the
+ *  drag-and-drop action is a move or copy of the drag data, or providing
+ *  different types of visual feedback based on the type of drag-and-drop
+ *  action.

+ *
+ *
You may also change the type of drag action by changing the
+ *  DragManager.showFeedback() method.
+ *  The default value of the action property is
+ *  DragManager.MOVE.

+ *
+ *  @see mx.managers.DragManager
+ *
+ *  @eventType mx.events.DragEvent.DRAG_OVER
+ */
+[Event(name="dragOver", type="mx.events.DragEvent")]
+
+/**
+ *  Dispatched by the component when the user drags outside the component,
+ *  but does not drop the data onto the target.
+ *
+ *
You use this event to restore the drop target to its normal appearance
+ *  if you modified its appearance as part of handling the
+ *  dragEnter or dragOver event.

+ *
+ *  @eventType mx.events.DragEvent.DRAG_EXIT
+ */
+[Event(name="dragExit", type="mx.events.DragEvent")]
+
+/**
+ *  Dispatched by the drop target when the user releases the mouse over it.
+ *
+ *
You use this event handler to add the drag data to the drop target.

+ *
+ *
If you call Event.preventDefault() in the event handler
+ *  for the dragDrop event for
+ *  a Tree control when dragging data from one Tree control to another,
+ *  it prevents the drop.

+ *
+ *  @eventType mx.events.DragEvent.DRAG_DROP
+ */
+[Event(name="dragDrop", type="mx.events.DragEvent")]
+
+/**
+ *  Dispatched by the drag initiator (the component that is the source
+ *  of the data being dragged) when the drag operation completes,
+ *  either when you drop the dragged data onto a drop target or when you end
+ *  the drag-and-drop operation without performing a drop.
+ *
+ *
You can use this event to perform any final cleanup
+ *  of the drag-and-drop operation.
+ *  For example, if you drag a List control item from one list to another,
+ *  you can delete the List control item from the source if you no longer
+ *  need it.

+ *
+ *
If you call Event.preventDefault() in the event handler
+ *  for the dragComplete event for
+ *  a Tree control when dragging data from one Tree control to another,
+ *  it prevents the drop.

+ *
+ *  @eventType mx.events.DragEvent.DRAG_COMPLETE
+ */
+[Event(name="dragComplete", type="mx.events.DragEvent")]
+
+/**
+ *  Dispatched by the drag initiator when starting a drag operation.
+ *  This event is used internally by the list-based controls;
+ *  you do not handle it when implementing drag and drop.
+ *  If you want to control the start of a drag-and-drop operation,
+ *  use the mouseDown or mouseMove event.
+ *
+ *  @eventType mx.events.DragEvent.DRAG_START
+ */
+[Event(name="dragStart", type="mx.events.DragEvent")]
+
+//--------------------------------------
+//  Effect events
+//--------------------------------------
+
+/**
+ *  Dispatched just before an effect starts.
+ *
+ *
The effect does not start changing any visuals
+ *  until after this event is fired.

+ *
+ *  @eventType mx.events.EffectEvent.EFFECT_START
+ */
+[Event(name="effectStart", type="mx.events.EffectEvent")]
+
+/**
+ *  Dispatched after an effect ends.
+ *
+ *
The effect will have made the last set of visual changes
+ *  before this event is fired, but those changes will not have
+ *  been rendered on the screen.
+ *  Thus, you might have to use the callLater() method
+ *  to delay any other changes that you want to make until after the
+ *  changes have been rendered onscreen.

+ *
+ *  @eventType mx.events.EffectEvent.EFFECT_END
+ */
+[Event(name="effectEnd", type="mx.events.EffectEvent")]
+
+
+//--------------------------------------
+//  State events
+//--------------------------------------
+
+/**
+ *  Dispatched after the currentState property changes,
+ *  but before the view state changes.
+ *
+ *  @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGING
+ */
+[Event(name="currentStateChanging", type="mx.events.StateChangeEvent")]
+
+/**
+ *  Dispatched after the view state has changed.
+ *
+ *  @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGE
+ */
+[Event(name="currentStateChange", type="mx.events.StateChangeEvent")]
+
+/**
+ *  Dispatched after the component has returned to the root view state.
+ *
+ *  @eventType mx.events.FlexEvent.ENTER_STATE
+ */
+[Event(name="enterState", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched before the component exits from the root view state.
+ *
+ *  @eventType mx.events.FlexEvent.EXIT_STATE
+ */
+[Event(name="exitState", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Tooltip events
+//--------------------------------------
+
+/**
+ *  Dispatched by the component when it is time to create a ToolTip.
+ *
+ *
If you create your own IToolTip object and place a reference
+ *  to it in the toolTip property of the event object
+ *  that is passed to your toolTipCreate handler,
+ *  the ToolTipManager displays your custom ToolTip.
+ *  Otherwise, the ToolTipManager creates an instance of
+ *  ToolTipManager.toolTipClass to display.

+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_CREATE
+ */
+[Event(name="toolTipCreate", type="mx.events.ToolTipEvent")]
+
+/**
+ *  Dispatched by the component when its ToolTip has been hidden
+ *  and will be discarded soon.
+ *
+ *
If you specify an effect using the
+ *  ToolTipManager.hideEffect property,
+ *  this event is dispatched after the effect stops playing.

+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_END
+ */
+[Event(name="toolTipEnd", type="mx.events.ToolTipEvent")]
+
+/**
+ *  Dispatched by the component when its ToolTip is about to be hidden.
+ *
+ *
If you specify an effect using the
+ *  ToolTipManager.hideEffect property,
+ *  this event is dispatched before the effect starts playing.

+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_HIDE
+ */
+[Event(name="toolTipHide", type="mx.events.ToolTipEvent")]
+
+/**
+ *  Dispatched by the component when its ToolTip is about to be shown.
+ *
+ *
If you specify an effect using the
+ *  ToolTipManager.showEffect property,
+ *  this event is dispatched before the effect starts playing.
+ *  You can use this event to modify the ToolTip before it appears.

+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOW
+ */
+[Event(name="toolTipShow", type="mx.events.ToolTipEvent")]
+
+/**
+ *  Dispatched by the component when its ToolTip has been shown.
+ *
+ *
If you specify an effect using the
+ *  ToolTipManager.showEffect property,
+ *  this event is dispatched after the effect stops playing.

+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_SHOWN
+ */
+[Event(name="toolTipShown", type="mx.events.ToolTipEvent")]
+
+/**
+ *  Dispatched by a component whose toolTip property is set,
+ *  as soon as the user moves the mouse over it.
+ *
+ *
The sequence of ToolTip events is toolTipStart,
+ *  toolTipCreate, toolTipShow,
+ *  toolTipShown, toolTipHide,
+ *  and toolTipEnd.

+ *
+ *  @eventType mx.events.ToolTipEvent.TOOL_TIP_START
+ */
+[Event(name="toolTipStart", type="mx.events.ToolTipEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/AnchorStyles.as";
+
+/**
+ *  Color of the component highlight when validation fails.
+ *  Flex also sets the borderColor style of the component to this
+ *  errorColor on a validation failure.
+ *
+ *  @default 0xFF0000
+ */
+[Style(name="errorColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Blend mode used by the focus rectangle.
+ *  For more information, see the blendMode property
+ *  of the flash.display.DisplayObject class.
+ *
+ *  @default "normal"
+ */
+[Style(name="focusBlendMode", type="String", inherit="no")]
+
+/**
+ *  Skin used to draw the focus rectangle.
+ *
+ *  @default mx.skins.halo.HaloFocusRect
+ */
+[Style(name="focusSkin", type="Class", inherit="no")]
+
+/**
+ *  Thickness, in pixels, of the focus rectangle outline.
+ *
+ *  @default 2
+ */
+[Style(name="focusThickness", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Theme color of a component. This property controls the appearance of highlights,
+ *  appearance when a component is selected, and other similar visual cues, but it
+ *  does not have any effect on the regular borders or background colors of the component.
+ *  The preferred values are haloGreen, haloBlue,
+ *  haloOrange, and haloSilver, although any valid color
+ *  value can be used.
+ *
+ *
The default values of the rollOverColor and
+ *  selectionColor styles are based on the
+ *  themeColor value.

+ *
+ *  @default "haloBlue"
+ */
+[Style(name="themeColor", type="uint", format="Color", inherit="yes")]
+
+//--------------------------------------
+//  Effects
+//--------------------------------------
+
+/**
+ *  Played when the component is created.
+ */
+[Effect(name="creationCompleteEffect", event="creationComplete")]
+
+/**
+ *  Played when the component is moved.
+ */
+[Effect(name="moveEffect", event="move")]
+
+/**
+ *  Played when the component is resized.
+ */
+[Effect(name="resizeEffect", event="resize")]
+
+/**
+ *  Played when the component becomes visible.
+ */
+[Effect(name="showEffect", event="show")]
+
+/**
+ *  Played when the component becomes invisible.
+ */
+[Effect(name="hideEffect", event="hide")]
+
+/**
+ *  Played when the user presses the mouse button while over the component.
+ */
+[Effect(name="mouseDownEffect", event="mouseDown")]
+
+/**
+ *  Played when the user releases the mouse button while over the component.
+ */
+[Effect(name="mouseUpEffect", event="mouseUp")]
+
+/**
+ *  Played when the user rolls the mouse over the component.
+ */
+[Effect(name="rollOverEffect", event="rollOver")]
+
+/**
+ *  Played when the user rolls the mouse so it is no longer over the component.
+ */
+[Effect(name="rollOutEffect", event="rollOut")]
+
+/**
+ *  Played when the component gains keyboard focus.
+ */
+[Effect(name="focusInEffect", event="focusIn")]
+
+/**
+ *  Played when the component loses keyboard focus.
+ */
+[Effect(name="focusOutEffect", event="focusOut")]
+
+/**
+ *  Played when the component is added as a child to a Container.
+ */
+[Effect(name="addedEffect", event="added")]
+
+/**
+ *  Played when the component is removed from a Container.
+ */
+[Effect(name="removedEffect", event="removed")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[AccessibilityClass(implementation="mx.accessibility.UIComponentAccImpl")]
+
+[ResourceBundle("core")]
+
+// skins resources aren't found because CSS visited by the compiler
+[ResourceBundle("skins")]
+
+/**
+ *  The UIComponent class is the base class for all visual components,
+ *  both interactive and noninteractive.
+ *
+ *
An interactive component can participate in tabbing and other kinds of
+ *  keyboard focus manipulation, accept low-level events like keyboard and
+ *  mouse input, and be disabled so that it does not receive keyboard and
+ *  mouse input.
+ *  This is in contrast to noninteractive components, like Label and
+ *  ProgressBar, which simply display contents and are not manipulated by
+ *  the user.

+ *
The UIComponent class is not used as an MXML tag, but is used as a base
+ *  class for other classes.

+ *
+ *  @mxml
+ *
+ *
All user interface components in Flex extend the UIComponent class.
+ *  Flex components inherit the following properties from the UIComponent
+ *  class:

+ *
+ *

+ *  <mx:tagname
+ *   Properties
+ *    automationName="null"
+ *    cachePolicy="auto|on|off"
+ *    currentState="null"
+ *    doubleClickEnabled="true|false"
+ *    enabled="true|false"
+ *    explicitHeight="NaN"
+ *    explicitMaxHeight="NaN"
+ *    explicitMaxWidth="NaN"
+ *    explicitMinHeight="NaN"
+ *    explicitMinWidth="NaN"
+ *    explicitWidth="NaN"
+ *    focusEnabled="true|false"
+ *    height="0"
+ *    id=""
+ *    includeInLayout="true|false"
+ *    maxHeight="10000"
+ *    maxWidth="10000"
+ *    measuredHeight=
+ *    measuredMinHeight=
+ *    measuredMinWidth=
+ *    measuredWidth=
+ *    minHeight="0"
+ *    minWidth="0"
+ *    mouseFocusEnabled="true|false"
+ *    percentHeight="NaN"
+ *    percentWidth="NaN"
+ *    scaleX="1.0"
+ *    scaleY="1.0"
+ *    states="null"
+ *    styleName="undefined"
+ *    toolTip="null"
+ *    transitions=""
+ *    validationSubField
+ *    width="0"
+ *    x="0"
+ *    y="0"
+ *
+ *  Styles
+ *    bottom="undefined"
+ *    errorColor="0xFF0000"
+ *    focusBlendMode="normal"
+ *    focusSkin="HaloFocusRect""
+ *    focusThickness="2"
+ *    horizontalCenter="undefined"
+ *    left="undefined"
+ *    right="undefined"
+ *    themeColor="haloGreen"
+ *    top="undefined"
+ *    verticalCenter="undefined"
+ *
+ *  Effects
+ *    addedEffect="No default"
+ *    creationCompleteEffect="No default"
+  *   focusInEffect="No default"
+ *    focusOutEffect="No default"
+ *    hideEffect="No default"
+ *    mouseDownEffect="No default"
+ *    mouseUpEffect="No default"
+ *    moveEffect="No default"
+ *    removedEffect="No default"
+ *    resizeEffect="No default"
+ *    rollOutEffect="No default"
+ *    rollOverEffect="No default"
+ *    showEffect="No default"
+ *
+ *  Events
+ *    add="No default"
+ *    creationComplete="No default"
+ *    currentStateChange="No default"
+ *    currentStateChanging="No default"
+ *    dragComplete="No default"
+ *    dragDrop="No default"
+ *    dragEnter="No default"
+ *    dragExit="No default"
+ *    dragOver="No default"
+ *    effectEnd="No default"
+ *    effectStart="No default"
+ *    enterState="No default"
+ *    exitState="No default"
+ *    hide="No default"
+ *    initialize="No default"
+ *    invalid="No default"
+ *    mouseDownOutside="No default"
+ *    mouseWheelOutside="No default"
+ *    move="No default"
+ *    preinitialize="No default"
+ *    record="No default"
+ *    remove="No default"
+ *    resize="No default"
+ *    show="No default"
+ *    toolTipCreate="No default"
+ *    toolTipEnd="No default"
+ *    toolTipHide="No default"
+ *    toolTipShow="No default"
+ *    toolTipShown="No default"
+ *    toolTipStart="No default"
+ *    updateComplete="No default"
+ *    valid="No default"
+ *    valueCommit="No default"
+ *  >
+ *

+ *
+ *  @see mx.core.UIComponent
+ */
+public class UIComponent extends FlexSprite
+       implements IAutomationObject, IChildList,
+                         IDeferredInstantiationUIComponent, IFlexDisplayObject,
+                         IFlexModule,
+                         IInvalidating, ILayoutManagerClient,
+                         IPropertyChangeNotifier, IRepeaterClient,
+                         ISimpleStyleClient, IStyleClient,
+                         IToolTipManagerClient, IUIComponent,
+                         IValidatorListener, IStateClient,
+                         IConstraintClient
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  The default value for the measuredWidth property.
+     *  Most components calculate a measuredWidth but some are flow-based and
+     *  have to pick a number that looks reasonable.
+     *
+     *  @default 160
+     */
+    public static const DEFAULT_MEASURED_WIDTH:Number = 160;
+
+    /**
+     *  The default value for the measuredMinWidth property.
+     *  Most components calculate a measuredMinWidth but some are flow-based and
+     *  have to pick a number that looks reasonable.
+     *
+     *  @default 40
+     */
+    public static const DEFAULT_MEASURED_MIN_WIDTH:Number = 40;
+
+    /**
+     *  The default value for the measuredHeight property.
+     *  Most components calculate a measuredHeight but some are flow-based and
+     *  have to pick a number that looks reasonable.
+     *
+     *  @default 22
+     */
+    public static const DEFAULT_MEASURED_HEIGHT:Number = 22;
+
+    /**
+     *  The default value for the measuredMinHeight property.
+     *  Most components calculate a measuredMinHeight but some are flow-based and
+     *  have to pick a number that looks reasonable.
+     *
+     *  @default 22
+     */
+    public static const DEFAULT_MEASURED_MIN_HEIGHT:Number = 22;
+
+    /**
+     *  The default value for the maxWidth property.
+     *
+     *  @default 10000
+     */
+    public static const DEFAULT_MAX_WIDTH:Number = 10000;
+
+    /**
+     *  The default value for the maxHeight property.
+     *
+     *  @default 10000
+     */
+    public static const DEFAULT_MAX_HEIGHT:Number = 10000;
+
+    /**
+     *  @private
+     *  The inheritingStyles and nonInheritingStyles properties
+     *  are initialized to this empty Object.
+     *  This allows the getStyle() and getStyle()
+     *  methods to simply access inheritingStyles[] and nonInheritingStyles[]
+     *  without needing to first check whether those objects exist.
+     *  If they were simply initialized to {}, we couldn't determine
+     *  whether the style chain has already been built or not.
+     */
+    mx_internal static var STYLE_UNINITIALIZED:Object = {};
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by UIComponentAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  embeddedFontRegistry
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the _embeddedFontRegistry property.
+     *  Note: This gets initialized on first access,
+     *  not when this class is initialized, in order to ensure
+     *  that the Singleton registry has already been initialized.
+     */
+    private static var _embeddedFontRegistry:IEmbeddedFontRegistry;
+
+    /**
+     *  @private
+     *  A reference to the embedded font registry.
+     *  Single registry in the system.
+     *  Used to look up the moduleFactory of a font.
+     */
+    private static function get embeddedFontRegistry():IEmbeddedFontRegistry
+    {
+        if (!_embeddedFontRegistry)
+        {
+            _embeddedFontRegistry = IEmbeddedFontRegistry(
+                Singleton.getInstance("mx.core::IEmbeddedFontRegistry"));
+        }
+
+        return _embeddedFontRegistry;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Blocks the background processing of methods
+     *  queued by callLater(),
+     *  until resumeBackgroundProcessing() is called.
+     *
+     *
These methods can be useful when you have time-critical code
+     *  which needs to execute without interruption.
+     *  For example, when you set the suspendBackgroundProcessing
+     *  property of an Effect to true,
+     *  suspendBackgroundProcessing() is automatically called
+     *  when it starts playing, and resumeBackgroundProcessing
+     *  is called when it stops, in order to ensure that the animation
+     *  is smooth.

+     *
+     *
Since the LayoutManager uses callLater(),
+     *  this means that commitProperties(),
+     *  measure(), and updateDisplayList()
+     *  will not get called in between calls to
+     *  suspendBackgroundProcessing() and
+     *  resumeBackgroundProcessing().

+     *
+     *
It is safe for both an outer method and an inner method
+     *  (i.e., one that the outer methods calls) to call
+     *  suspendBackgroundProcessing()
+     *  and resumeBackgroundProcessing(), because these
+     *  methods actually increment and decrement a counter
+     *  which determines whether background processing occurs.

+     */
+    public static function suspendBackgroundProcessing():void
+    {
+        UIComponentGlobals.callLaterSuspendCount++;
+    }
+
+    /**
+     *  Resumes the background processing of methods
+     *  queued by callLater(), after a call to
+     *  suspendBackgroundProcessing().
+     *
+     *
Refer to the description of
+     *  suspendBackgroundProcessing() for more information.

+     */
+    public static function resumeBackgroundProcessing():void
+    {
+        if (UIComponentGlobals.callLaterSuspendCount > 0)
+        {
+            UIComponentGlobals.callLaterSuspendCount--;
+
+            // Once the suspend count gets back to 0, we need to
+            // force a render event to happen
+            if (UIComponentGlobals.callLaterSuspendCount == 0)
+            {
+                var sm:ISystemManager = SystemManagerGlobals.topLevelSystemManagers[0];
+                if (sm && sm.stage)
+                    sm.stage.invalidate();
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function UIComponent()
+    {
+        super();
+
+        // Override  variables in superclasses.
+        focusRect = false; // We do our own focus drawing.
+        tabEnabled = (this is IFocusManagerComponent);
+            // We are tab enabled by default if IFocusManagerComponent
+        tabChildren = false;
+
+        // Whether the component can accept user interaction.
+        // The default is true. If you set enabled to false for a container,
+        // Flex dims the color of the container and of all of its children,
+        // and blocks user input  to the container and to all of its children.
+        // We set enabled to true here because some components keep their
+        // own _enabled flag and may not initialize it to true.
+        enabled = true;
+
+        // Make the component invisible until the initialization sequence
+        // is complete.
+        // It will be set visible when the 'initialized' flag is set.
+        $visible = false;
+
+        addEventListener(Event.ADDED, addedHandler);
+        addEventListener(Event.REMOVED, removedHandler);
+
+        // Register for focus and keyboard events.
+        if (this is IFocusManagerComponent)
+        {
+            addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
+            addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
+            addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+            addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
+        }
+
+        resourcesChanged();
+
+        // Register as a weak listener for "change" events from ResourceManager.
+        // If UIComponents registered as a strong listener,
+        // they wouldn't get garbage collected.
+        resourceManager.addEventListener(
+            Event.CHANGE, resourceManager_changeHandler, false, 0, true);
+
+        _width = super.width;
+        _height = super.height;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  There is a bug (139381) where we occasionally get callLaterDispatcher()
+     *  even though we didn't expect it.
+     *  That causes us to do a removeEventListener() twice,
+     *  which messes up some internal thing in the player so that
+     *  the next addEventListener() doesn't actually get us the render event.
+     */
+    private var listeningForRender:Boolean = false;
+
+    /**
+     *  @private
+     *  List of methods used by callLater().
+     */
+    private var methodQueue:Array /* of MethodQueueElement */ = [];
+
+    /**
+     *  @private
+     *  Whether or not we "own" the focus graphic
+     */
+    private var hasFocusRect:Boolean = false;
+
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Creation
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  initialized
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the initialized property.
+     */
+    private var _initialized:Boolean = false;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  A flag that determines if an object has been through all three phases
+     *  of layout: commitment, measurement, and layout (provided that any were required).
+     */
+    public function get initialized():Boolean
+    {
+        return _initialized;
+    }
+
+    /**
+     *  @private
+     */
+    public function set initialized(value:Boolean):void
+    {
+        _initialized = value;
+
+        if (value)
+        {
+            setVisible(_visible, true);
+
+            dispatchEvent(new FlexEvent(FlexEvent.CREATION_COMPLETE));
+        }
+    }
+
+    //----------------------------------
+    //  processedDescriptors
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the processedDescriptors property.
+     */
+    private var _processedDescriptors:Boolean = false;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Set to true after immediate or deferred child creation,
+     *  depending on which one happens. For a Container object, it is set
+     *  to true at the end of
+     *  the createComponentsFromDescriptors() method,
+     *  meaning after the Container object creates its children from its child descriptors.
+     *
+     *
For example, if an Accordion container uses deferred instantiation,
+     *  the processedDescriptors property for the second pane of
+     *  the Accordion container does not become true until after
+     *  the user navigates to that pane and the pane creates its children.
+     *  But, if the Accordion had set the creationPolicy property
+     *  to "all", the processedDescriptors property
+     *  for its second pane is set to true during application startup.

+     *
+     *
For classes that are not containers, which do not have descriptors,
+     *  it is set to true after the createChildren()
+     *  method creates any internal component children.

+     */
+    public function get processedDescriptors():Boolean
+    {
+        return _processedDescriptors;
+    }
+
+    /**
+     *  @private
+     */
+    public function set processedDescriptors(value:Boolean):void
+    {
+        _processedDescriptors = value;
+
+        if (value)
+            dispatchEvent(new FlexEvent(FlexEvent.INITIALIZE));
+    }
+
+    //----------------------------------
+    //  updateCompletePendingFlag
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the updateCompletePendingFlag property.
+     */
+    private var _updateCompletePendingFlag:Boolean = false;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  A flag that determines if an object has been through all three phases
+     *  of layout validation (provided that any were required).
+     */
+    public function get updateCompletePendingFlag():Boolean
+    {
+        return _updateCompletePendingFlag;
+    }
+
+    /**
+     *  @private
+     */
+    public function set updateCompletePendingFlag(value:Boolean):void
+    {
+        _updateCompletePendingFlag = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Invalidation
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Whether this component needs to have its
+     *  commitProperties() method called.
+     */
+    mx_internal var invalidatePropertiesFlag:Boolean = false;
+
+    /**
+     *  @private
+     *  Whether this component needs to have its
+     *  measure() method called.
+     */
+    mx_internal var invalidateSizeFlag:Boolean = false;
+
+    /**
+     *  @private
+     *  Whether this component needs to be have its
+     *  updateDisplayList() method called.
+     */
+    mx_internal var invalidateDisplayListFlag:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Measurement
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the x property.
+     *  Used in dispatching a MoveEvent.
+     */
+    private var oldX:Number = 0;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the y property.
+     *  Used in dispatching a MoveEvent.
+     */
+    private var oldY:Number = 0;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the width property.
+     *  Used in dispatching a ResizeEvent.
+     */
+    private var oldWidth:Number = 0;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the height property.
+     *  Used in dispatching a ResizeEvent.
+     */
+    private var oldHeight:Number = 0;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the minWidth property.
+     */
+    private var oldMinWidth:Number;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the minHeight property.
+     */
+    private var oldMinHeight:Number;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the explicitWidth property.
+     */
+    private var oldExplicitWidth:Number;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the explicitHeight property.
+     */
+    private var oldExplicitHeight:Number;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the scaleX property.
+     */
+    private var oldScaleX:Number = 1.0;
+
+    /**
+     *  @private
+     *  Holds the last recorded value of the scaleY property.
+     */
+    private var oldScaleY:Number = 1.0;
+
+    /**
+     *  @private
+     * True if createInFontContext has been called.
+     */
+    private var hasFontContextBeenSaved:Boolean = false;
+
+    /**
+     *  @private
+     * Holds the last recorded value of the module factory used to create the font.
+     */
+    private var oldEmbeddedFontContext:IFlexModuleFactory = null;
+
+    /**
+     * @private
+     *
+     * Cache last value of embedded font.
+     */
+    private var cachedEmbeddedFont:EmbeddedFont = null;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Styles
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var cachedTextFormat:UITextFormat;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Effects
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Sprite used to display an overlay.
+     */
+    mx_internal var overlay:UIComponent;
+
+    /**
+     *  @private
+     *  Color used for overlay.
+     */
+    mx_internal var overlayColor:uint;
+
+    /**
+     *  @private
+     *  Counter to keep track of the number of current users
+     *  of the overlay.
+     */
+    mx_internal var overlayReferenceCount:int = 0;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Validation
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    mx_internal var saveBorderColor:Boolean = true;
+
+    /**
+     *  @private
+     */
+    mx_internal var origBorderColor:Number;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables: Other
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Storage for automatically-created RadioButtonGroups.
+     *  If a RadioButton's groupName isn't the id of a RadioButtonGroup tag,
+     *  we automatically create a RadioButtonGroup and store it here as
+     *  document.automaticRadioButtonGroups[groupName] = theRadioButtonGroup;
+     */
+    mx_internal var automaticRadioButtonGroups:Object;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  owner
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _owner:DisplayObjectContainer;
+
+    /**
+     *  The owner of this UIComponent. By default, it is the parent of this UIComponent.
+     *  However, if this UIComponent object is a child component that is
+     *  popped up by its parent, such as the dropdown list of a ComboBox control,
+     *  the owner is the component that popped up this UIComponent object.
+     *
+     *
This property is not managed by Flex, but by each component.
+     *  Therefore, if you use the PopUpManger.createPopUp() or
+     *  PopUpManger.addPopUp() method to pop up a child component,
+     *  you should set the owner property of the child component
+     *  to the component that popped it up.

+     *
+     *
The default value is the value of the parent property.

+     */
+    public function get owner():DisplayObjectContainer
+    {
+        return _owner ? _owner : parent;
+    }
+
+    public function set owner(value:DisplayObjectContainer):void
+    {
+        _owner = value;
+    }
+
+    //----------------------------------
+    //  parent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Reference to this component's virtual parent container.
+     *  "Virtual" means that this parent may not be the same
+     *  as the one that the Player returns as the 'parent'
+     *  property of a DisplayObject.
+     *  For example, if a Container has created a contentPane
+     *  to improve scrolling performance,
+     *  then its "children" are really its grandchildren
+     *  and their "parent" is actually their grandparent,
+     *  because we don't want developers to be concerned with
+     *  whether a contentPane exists or not.
+     */
+    mx_internal var _parent:DisplayObjectContainer;
+
+    /**
+     *  The parent container or component for this component.
+     *  Only UIComponent objects should have a parent property.
+     *  Non-UIComponent objects should use another property to reference
+     *  the object to which they belong.
+     *  By convention, non-UIComponent objects use an owner
+     *  property to reference the object to which they belong.
+     */
+    override public function get parent():DisplayObjectContainer
+    {
+        // Flash PlaceObject tags can have super.parent set
+        // before we get to setting the _parent property.
+        return _parent ? _parent : super.parent;
+    }
+
+    //----------------------------------
+    //  x
+    //----------------------------------
+
+    [Bindable("xChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Number that specifies the component's horizontal position,
+     *  in pixels, within its parent container.
+     *
+     *
Setting this property directly or calling move()
+     *  will have no effect -- or only a temporary effect -- if the
+     *  component is parented by a layout container such as HBox, Grid,
+     *  or Form, because the layout calculations of those containers
+     *  set the x position to the results of the calculation.
+     *  However, the x property must almost always be set
+     *  when the parent is a Canvas or other absolute-positioning
+     *  container because the default value is 0.

+     *
+     *  @default 0
+     */
+    override public function get x():Number
+    {
+        return super.x;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set x(value:Number):void
+    {
+        if (super.x == value)
+            return;
+
+        super.x = value;
+
+        invalidateProperties();
+
+        dispatchEvent(new Event("xChanged"));
+    }
+
+    //----------------------------------
+    //  y
+    //----------------------------------
+
+    [Bindable("yChanged")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Number that specifies the component's vertical position,
+     *  in pixels, within its parent container.
+     *
+     *
Setting this property directly or calling move()
+     *  will have no effect -- or only a temporary effect -- if the
+     *  component is parented by a layout container such as HBox, Grid,
+     *  or Form, because the layout calculations of those containers
+     *  set the x position to the results of the calculation.
+     *  However, the x property must almost always be set
+     *  when the parent is a Canvas or other absolute-positioning
+     *  container because the default value is 0.

+     *
+     *  @default 0
+     */
+    override public function get y():Number
+    {
+        return super.y;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set y(value:Number):void
+    {
+        if (super.y == value)
+            return;
+
+        super.y = value;
+
+        invalidateProperties();
+
+        dispatchEvent(new Event("yChanged"));
+    }
+
+    //----------------------------------
+    //  width
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the width property.
+     */
+    mx_internal var _width:Number;
+
+    [Bindable("widthChanged")]
+    [Inspectable(category="General")]
+    [PercentProxy("percentWidth")]
+
+    /**
+     *  Number that specifies the width of the component, in pixels,
+     *  in the parent's coordinates.
+     *  The default value is 0, but this property will contain the actual component
+     *  width after Flex completes sizing the components in your application.
+     *
+     *
Note: You can specify a percentage value in the MXML
+     *  width attribute, such as width="100%",
+     *  but you cannot use a percentage value in the width
+     *  property in ActionScript.
+     *  Use the percentWidth property instead.

+     *
+     *
Setting this property causes a resize event to
+     *  be dispatched.
+     *  See the resize event for details on when
+     *  this event is dispatched.
+     *  If the component's scaleX property is not 1.0,
+     *  the width of the component from its internal coordinates
+     *  will not match.
+     *  Thus a 100 pixel wide component with a scaleX
+     *  of 2 will take 100 pixels in the parent, but will
+     *  internally think it is 50 pixels wide.

+     */
+    override public function get width():Number
+    {
+        return _width;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set width(value:Number):void
+    {
+        if (explicitWidth != value)
+        {
+            explicitWidth = value;
+
+            // We invalidate size because locking in width
+            // may change the measured height in flow-based components.
+            invalidateSize();
+        }
+
+        if (_width != value)
+        {
+            invalidateProperties();
+            invalidateDisplayList();
+
+            var p:IInvalidating = parent as IInvalidating;
+            if (p && includeInLayout)
+            {
+                p.invalidateSize();
+                p.invalidateDisplayList();
+            }
+
+            _width = value;
+
+            dispatchEvent(new Event("widthChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  height
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the height property.
+     */
+    mx_internal var _height:Number;
+
+    [Bindable("heightChanged")]
+    [Inspectable(category="General")]
+    [PercentProxy("percentHeight")]
+
+    /**
+     *  Number that specifies the height of the component, in pixels,
+     *  in the parent's coordinates.
+     *  The default value is 0, but this property will contain the actual component
+     *  height after Flex completes sizing the components in your application.
+     *
+     *
Note: You can specify a percentage value in the MXML
+     *  height attribute, such as height="100%",
+     *  but you cannot use a percentage value for the height
+     *  property in ActionScript;
+     *  use the percentHeight property instead.

+     *
+     *
Setting this property causes a resize event to be dispatched.
+     *  See the resize event for details on when
+     *  this event is dispatched.
+     *  If the component's scaleY property is not 100,
+     *  the height of the component from its internal coordinates
+     *  will not match.
+     *  Thus a 100 pixel high component with a scaleY
+     *  of 200 will take 100 pixels in the parent, but will
+     *  internally think it is 50 pixels high.

+     */
+    override public function get height():Number
+    {
+        return _height;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set height(value:Number):void
+    {
+        if (explicitHeight != value)
+        {
+            explicitHeight = value;
+
+            // We invalidate size because locking in width
+            // may change the measured height in flow-based components.
+            invalidateSize();
+        }
+
+        if (_height != value)
+        {
+            invalidateProperties();
+            invalidateDisplayList();
+
+            var p:IInvalidating = parent as IInvalidating;
+            if (p && includeInLayout)
+            {
+                p.invalidateSize();
+                p.invalidateDisplayList();
+            }
+
+            _height = value;
+
+            dispatchEvent(new Event("heightChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  scaleX
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the scaleX property.
+     */
+    private var _scaleX:Number = 1.0;
+
+    [Bindable("scaleXChanged")]
+    [Inspectable(category="Size", defaultValue="1.0")]
+
+    /**
+     *  Number that specifies the horizontal scaling factor.
+     *
+     *
The default value is 1.0, which means that the object
+     *  is not scaled.
+     *  A scaleX of 2.0 means the object has been
+     *  magnified by a factor of 2, and a scaleX of 0.5
+     *  means the object has been reduced by a factor of 2.

+     *
+     *
A value of 0.0 is an invalid value.
+     *  Rather than setting it to 0.0, set it to a small value, or set
+     *  the visible property to false to hide the component.

+     *
+     *  @default 1.0
+     */
+    override public function get scaleX():Number
+    {
+        return _scaleX;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set scaleX(value:Number):void
+    {
+        if (_scaleX == value)
+            return;
+
+        _scaleX = value;
+
+        invalidateProperties();
+        invalidateSize();
+
+        dispatchEvent(new Event("scaleXChanged"));
+    }
+
+    //----------------------------------
+    //  scaleY
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the scaleY property.
+     */
+    private var _scaleY:Number = 1.0;
+
+    [Bindable("scaleYChanged")]
+    [Inspectable(category="Size", defaultValue="1.0")]
+
+    /**
+     *  Number that specifies the vertical scaling factor.
+     *
+     *
The default value is 1.0, which means that the object
+     *  is not scaled.
+     *  A scaleY of 2.0 means the object has been
+     *  magnified by a factor of 2, and a scaleY of 0.5
+     *  means the object has been reduced by a factor of 2.

+     *
+     *
A value of 0.0 is an invalid value.
+     *  Rather than setting it to 0.0, set it to a small value, or set
+     *  the visible property to false to hide the component.

+     *
+     *  @default 1.0
+     */
+    override public function get scaleY():Number
+    {
+        return _scaleY;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set scaleY(value:Number):void
+    {
+        if (_scaleY == value)
+            return;
+
+        _scaleY = value;
+
+        invalidateProperties();
+        invalidateSize();
+
+        dispatchEvent(new Event("scaleYChanged"));
+    }
+
+    //----------------------------------
+    //  visible
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the visible property.
+     */
+    private var _visible:Boolean = true;
+
+    [Bindable("hide")]
+    [Bindable("show")]
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  Controls the visibility of this UIComponent. If true,
+     *  the object is visible.
+     *
+     *
When setting to true, the object will dispatch
+     *  a show event.
+     *  When setting to false, the object will dispatch
+     *  a hide event.
+     *  In either case the children of the object will not emit a
+     *  show or hide event unless the object
+     *  has specifically written an implementation to do so.

+     *
+     *  @default true
+     */
+    override public function get visible():Boolean
+    {
+        return _visible;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set visible(value:Boolean):void
+    {
+        setVisible(value);
+    }
+
+    /**
+     *  Called when the visible property changes.
+     *  You should set the visible property to show or hide
+     *  a component instead of calling this method directly.
+     *
+     *  @param value The new value of the visible property.
+     *  Specify true to show the component, and false to hide it.
+     *
+     *  @param noEvent If true, do not dispatch an event.
+     *  If false, dispatch a show event when
+     *  the component becomes visible, and a hide event when
+     *  the component becomes invisible.
+     */
+    public function setVisible(value:Boolean,
+                               noEvent:Boolean = false):void
+    {
+        _visible = value;
+
+        if (!initialized)
+            return;
+
+        if ($visible == value)
+            return;
+
+        $visible = value;
+
+        if (!noEvent)
+        {
+            dispatchEvent(new FlexEvent(value ?
+                                        FlexEvent.SHOW :
+                                        FlexEvent.HIDE));
+        }
+    }
+
+    //----------------------------------
+    //  alpha
+    //----------------------------------
+
+    [Bindable("alphaChanged")]
+    [Inspectable(defaultValue="1.0", category="General", verbose="1")]
+
+    /**
+     *  @private
+     */
+    override public function set alpha(value:Number):void
+    {
+        super.alpha = value;
+
+        dispatchEvent(new Event("alphaChanged"));
+    }
+
+    //----------------------------------
+    //  doubleClickEnabled
+    //----------------------------------
+
+    [Inspectable(enumeration="true,false", defaultValue="true")]
+
+    /**
+     *  Specifies whether the UIComponent object receives doubleClick events.
+     *  The default value is true, which means that the UIComponent object
+     *  receives doubleClick events.
+     *
+     *
The mouseEnabled property must also be set to true,
+     *  its default value, for the object to receive doubleClick events.

+     *
+     *  @default false
+     */
+    override public function get doubleClickEnabled():Boolean
+    {
+        return super.doubleClickEnabled;
+    }
+
+    /**
+     *  @private
+     *  Propagate to children.
+     */
+    override public function set doubleClickEnabled(value:Boolean):void
+    {
+        super.doubleClickEnabled = value;
+
+        var childList:IChildList;
+
+        if (this is IRawChildrenContainer)
+            childList = IRawChildrenContainer(this).rawChildren;
+        else
+            childList = IChildList(this);
+
+        for (var i:int = 0; i < childList.numChildren; i++)
+        {
+            var child:InteractiveObject = childList.getChildAt(i) as InteractiveObject;
+            if (child)
+                child.doubleClickEnabled = value;
+        }
+    }
+
+    //----------------------------------
+    //  enabled
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _enabled:Boolean = false;
+
+    [Inspectable(category="General", enumeration="true,false", defaultValue="true")]
+    [Bindable("enabledChanged")]
+
+    /**
+     *  @copy mx.core.IUIComponent#enabled
+     */
+    public function get enabled():Boolean
+    {
+        return _enabled;
+    }
+
+    /**
+     *  @private
+     */
+    public function set enabled(value:Boolean):void
+    {
+        _enabled = value;
+
+        // Need to flush the cached TextFormat
+        // so it recalcs with the disabled color,
+        cachedTextFormat = null;
+
+        invalidateDisplayList();
+
+        dispatchEvent(new Event("enabledChanged"));
+    }
+
+    //----------------------------------
+    //  cacheAsBitmap
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set cacheAsBitmap(value:Boolean):void
+    {
+        super.cacheAsBitmap = value;
+
+        // If cacheAsBitmap is set directly,
+        // reset the value of cacheAsBitmapCount.
+        cacheAsBitmapCount = value ? 1 : 0;
+    }
+
+    //----------------------------------
+    //  filters
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the filters property.
+     */
+    private var _filters:Array;
+
+    /**
+     *  @private
+     */
+    override public function get filters():Array
+    {
+        return _filters ? _filters : super.filters;
+    }
+
+    /**
+     *  @private
+     */
+    override public function set filters(value:Array):void
+    {
+        var n:int;
+        var i:int;
+        var e:IEventDispatcher;
+
+        if (_filters)
+        {
+            n = _filters.length;
+            for (i = 0; i < n; i++)
+            {
+                e = _filters[i] as IEventDispatcher;
+                if (e)
+                    e.removeEventListener("change", filterChangeHandler);
+            }
+        }
+
+        _filters = value;
+
+        if (_filters)
+        {
+            n = _filters.length;
+            for (i = 0; i < n; i++)
+            {
+                e = _filters[i] as IEventDispatcher;
+                if (e)
+                    e.addEventListener("change", filterChangeHandler);
+            }
+        }
+
+        super.filters = _filters;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: Display
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  $parent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'parent' property, which can be useful since components
+     *  can override 'parent' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $parent():DisplayObjectContainer
+    {
+        return super.parent;
+    }
+
+    //----------------------------------
+    //  $x
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'x' property, which can be useful since components
+     *  can override 'x' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $x():Number
+    {
+        return super.x;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal final function set $x(value:Number):void
+    {
+        super.x = value;
+    }
+
+    //----------------------------------
+    //  $y
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'y' property, which can be useful since components
+     *  can override 'y' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $y():Number
+    {
+        return super.y;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal final function set $y(value:Number):void
+    {
+        super.y = value;
+    }
+
+    //----------------------------------
+    //  $width
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'width' property, which can be useful since components
+     *  can override 'width' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $width():Number
+    {
+        return super.width;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal final function set $width(value:Number):void
+    {
+        super.width = value;
+    }
+
+    //----------------------------------
+    //  $height
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'height' property, which can be useful since components
+     *  can override 'height' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $height():Number
+    {
+        return super.height;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal final function set $height(value:Number):void
+    {
+        super.height = value;
+    }
+
+    //----------------------------------
+    //  $visible
+    //----------------------------------
+
+    /**
+     *  @private
+     *  This property allows access to the Player's native implementation
+     *  of the 'visible' property, which can be useful since components
+     *  can override 'visible' and thereby hide the native implementation.
+     *  Note that this "base property" is final and cannot be overridden,
+     *  so you can count on it to reflect what is happening at the player level.
+     */
+    mx_internal final function get $visible():Boolean
+    {
+        return super.visible;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal final function set $visible(value:Boolean):void
+    {
+        super.visible = value;
+    }
+
+    //----------------------------------
+    //  contentMouseX
+    //----------------------------------
+
+    /**
+     *  Returns the x position of the mouse, in the content coordinate system.
+     *  Content coordinates specify a pixel position relative to the upper left
+     *  corner of the component's content, and include all of the component's
+     *  content area, including any regions that are currently clipped and must
+     *  be accessed by scrolling the component.
+     */
+    public function get contentMouseX():Number
+    {
+        return mouseX;
+    }
+
+    //----------------------------------
+    //  contentMouseY
+    //----------------------------------
+
+    /**
+     *  Returns the y position of the mouse, in the content coordinate system.
+     *  Content coordinates specify a pixel position relative to the upper left
+     *  corner of the component's content, and include all of the component's
+     *  content area, including any regions that are currently clipped and must
+     *  be accessed by scrolling the component.
+     */
+    public function get contentMouseY():Number
+    {
+        return mouseY;
+    }
+
+    //----------------------------------
+    //  tweeningProperties
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _tweeningProperties:Array;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Array of properties that are currently being tweened on this object.
+     *
+     *
Used to alert the EffectManager that certain properties of this object
+     *  are being tweened, so that the EffectManger doesn't attempt to animate
+     *  the same properties.

+     */
+    public function get tweeningProperties():Array
+    {
+        return _tweeningProperties;
+    }
+
+    /**
+     *  @private
+     */
+    public function set tweeningProperties(value:Array):void
+    {
+        _tweeningProperties = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: Manager access
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  cursorManager
+    //----------------------------------
+
+    /**
+     *  Gets the CursorManager that controls the cursor for this component
+     *  and its peers.
+     *  Each top-level window has its own instance of a CursorManager;
+     *  To make sure you're talking to the right one, use this method.
+     */
+    public function get cursorManager():ICursorManager
+    {
+        var o:DisplayObject = parent;
+
+        while (o)
+        {
+            if (o is IUIComponent && "cursorManager" in o)
+                if (o["cursorManager"] != null)
+                    return o["cursorManager"];
+
+            o = o.parent;
+        }
+
+        return CursorManager.getInstance();
+    }
+
+    //----------------------------------
+    //  focusManager
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the focusManager property.
+     */
+    private var _focusManager:IFocusManager;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Gets the FocusManager that controls focus for this component
+     *  and its peers.
+     *  Each popup has its own focus loop and therefore its own instance
+     *  of a FocusManager.
+     *  To make sure you're talking to the right one, use this method.
+     */
+    public function get focusManager():IFocusManager
+    {
+        if (_focusManager)
+            return _focusManager;
+
+        var o:DisplayObject = parent;
+
+        while (o)
+        {
+            if (o is IFocusManagerContainer)
+                return IFocusManagerContainer(o).focusManager;
+
+            o = o.parent;
+        }
+
+        return null;
+    }
+
+    /**
+     *  @private
+     *  IFocusManagerContainers have this property assigned by the framework
+     */
+    public function set focusManager(value:IFocusManager):void
+    {
+        _focusManager = value;
+    }
+
+    //----------------------------------
+    //  resourceManager
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the resourceManager property.
+     */
+    private var _resourceManager:IResourceManager = ResourceManager.getInstance();
+
+    /**
+     *  @private
+     *  This metadata suppresses a trace() in PropertyWatcher:
+     *  "warning: unable to bind to property 'resourceManager' ..."
+     */
+    [Bindable("unused")]
+
+    /**
+     *  A reference to the object which manages
+     *  all of the application's localized resources.
+     *  This is a singleton instance which implements
+     *  the IResourceManager interface.
+     */
+    protected function get resourceManager():IResourceManager
+    {
+        return _resourceManager;
+    }
+
+    //----------------------------------
+    //  systemManager
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the systemManager property.
+     *  Set by the SystemManager so that each UIComponent
+     *  has a references to its SystemManager
+     */
+    private var _systemManager:ISystemManager;
+
+    /**
+     *  @private
+     *  if component has been reparented, we need to potentially
+     *  reassign systemManager, cause we could be in a new Window.
+     */
+    private var _systemManagerDirty:Boolean = false;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Returns the SystemManager object used by this component.
+     */
+    public function get systemManager():ISystemManager
+    {
+        if (!_systemManager || _systemManagerDirty)
+        {
+            var r:DisplayObject = root;
+            if (r && !(r is Stage))
+            {
+                // If this object is attached to the display list, then
+                // the root property holds its SystemManager.
+                _systemManager = (r as ISystemManager);
+            }
+          else if (r)
+            {
+                // if the root is the Stage, then we are in a second AIR window
+                _systemManager = Stage(r).getChildAt(0) as ISystemManager;
+            }
+            else
+            {
+                // If this object isn't attached to the display list, then
+                // we need to walk up the parent chain ourselves.
+                var o:DisplayObjectContainer = parent;
+                while (o)
+                {
+                    var ui:IUIComponent = o as IUIComponent;
+                    if (ui)
+                    {
+                        _systemManager = ui.systemManager;
+                        break;
+                    }
+                    o = o.parent;
+                }
+            }
+            _systemManagerDirty = false;
+        }
+
+        return _systemManager;
+    }
+
+    /**
+     *  @private
+     */
+    public function set systemManager(value:ISystemManager):void
+    {
+        _systemManager = value;
+        _systemManagerDirty = false;
+    }
+
+    /**
+     *  @private
+     *  Returns the current system manager, systemManager,
+     *  unless it is null.
+     *  If the current system manager is null,
+     *  then search to find the correct system manager.
+     *
+     *  @return A system manager, will not be null.
+     */
+    mx_internal function getNonNullSystemManager():ISystemManager
+    {
+        var sm:ISystemManager = systemManager;
+
+        if (!sm)
+            sm = ISystemManager(SystemManager.getSWFRoot(this));
+
+        if (!sm)
+            return SystemManagerGlobals.topLevelSystemManagers[0];
+
+        return sm;
+    }
+
+    //----------------------------------
+    //  nestLevel
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the nestLevel property.
+     */
+    private var _nestLevel:int = 0;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Depth of this object in the containment hierarchy.
+     *  This number is used by the measurement and layout code.
+     *  The value is 0 if this component is not on the DisplayList.
+     */
+    public function get nestLevel():int
+    {
+        return _nestLevel;
+    }
+
+    /**
+     *  @private
+     */
+    public function set nestLevel(value:int):void
+    {
+        // If my parent hasn't been attached to the display list, then its nestLevel
+        // will be zero.  If it tries to set my nestLevel to 1, ignore it.  We'll
+        // update nest levels again after the parent is added to the display list.
+        //
+        // Also punt if the new value for nestLevel is the same as my current value.
+        if (value > 1 && _nestLevel != value)
+        {
+            _nestLevel = value;
+
+            updateCallbacks();
+
+            var childList:IChildList = (this is IRawChildrenContainer) ?
+                IRawChildrenContainer(this).rawChildren : IChildList(this);
+            var n:int = childList.numChildren;
+            for (var i:int = 0; i < n; i++)
+            {
+                var ui:ILayoutManagerClient  = childList.getChildAt(i) as ILayoutManagerClient;
+                if (ui)
+                {
+                    ui.nestLevel = value + 1;
+                }
+                else
+                {
+                    var textField:IUITextField = childList.getChildAt(i) as IUITextField;
+
+                    if (textField)
+                        textField.nestLevel = value + 1;
+                }
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties: MXML
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  descriptor
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the descriptor property.
+     *  This variable is initialized in the construct() method
+     *  using the _descriptor in the initObj, which is set in
+     *  createComponentFromDescriptor().
+     *  If this UIComponent was not created by createComponentFromDescriptor(),
+     *  its 'descriptor' property is null.
+     */
+    mx_internal var _descriptor:UIComponentDescriptor;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  Reference to the UIComponentDescriptor, if any, that was used
+     *  by the createComponentFromDescriptor() method to create this
+     *  UIComponent instance. If this UIComponent instance
+     *  was not created from a descriptor, this property is null.
+     *
+     *  @see mx.core.UIComponentDescriptor
+     */
+    public function get descriptor():UIComponentDescriptor
+    {
+        return _descriptor;
+    }
+
+    /**
+     *  @private
+     */
+    public function set descriptor(value:UIComponentDescriptor):void
+    {
+        _descriptor = value;
+    }
+
+    //----------------------------------
+    //  document
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the document property.
+     *  This variable is initialized in the init() method.
+     *  A document object (i.e., an Object at the top of the hierarchy
+     *  of a Flex application, MXML component, or AS component) has an
+     *  autogenerated override of initalize() which sets its _document to
+     *  'this', so that its 'document' property is a reference to itself.
+     *  Other UIComponents set their _document to their parent's _document,
+     *  so that their 'document' property refers to the document object
+     *  that they are inside.
+     */
+    mx_internal var _document:Object;
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  A reference to the document object associated with this UIComponent.
+     *  A document object is an Object at the top of the hierarchy of a
+     *  Flex application, MXML component, or AS component.
+     */
+    public function get document():Object
+    {
+        return _document;
+    }
+
+    /**
+     *  A reference to the document object associated with this UIComponent.
+     *  A document object is an Object at the top of the hierarchy of a
+     *  Flex application, MXML component, or AS component.
+     */
+    public function set document(value:Object):void
+    {
+        var n:int = numChildren;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:IUIComponent = getChildAt(i) as IUIComponent;
+            if (!child)
+                continue;
+
+            if (child.document == _document ||
+                child.document == ApplicationGlobals.application)
+            {
+                child.document = value;
+            }
+        }
+
+        _document = value;
+    }
+
+    //----------------------------------
+    //  documentDescriptor
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the documentDescriptor property.
+     *  A document object (i.e., a UIComponent at the top of the
+     *  hierarchy of a Flex application, MXML component,
+     *  or AS component) has an autogenerated override of init()
+     *  which sets its _documentDescriptor to the descriptor
+     *  at the top of the autogenerated descriptor tree for that
+     *  document. For other UIComponents, _documentDescriptor is
+     *  never defined.
+     */
+    mx_internal var _documentDescriptor:UIComponentDescriptor;
+
+    /**
+     *  @private
+     *  For a document object, which is an instance of a UIComponent
+     *  at the top of the hierarchy of a Flex application, MXML
+     *  component, or ActionScript component, the
+     *  documentDescriptor property is a reference
+     *  to the UIComponentDescriptor at the top of the autogenerated
+     *  descriptor tree for that document, which describes the
+     *  set of children and their attributes for that document.
+     *  For other UIComponents, it is null.
+     */
+    mx_internal function get documentDescriptor():UIComponentDescriptor
+    {
+        return _documentDescriptor;
+    }
+
+    //----------------------------------
+    //  id
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _id:String;
+
+    /**
+     *  ID of the component. This value becomes the instance name of the object
+     *  and should not contain any white space or special characters. Each component
+     *  throughout an application should have a unique id.
+     *
+     *
If your application is going to be tested by third party tools, give each component
+     *  a meaningful id. Testing tools use ids to represent the control in their scripts and
+     *  having a meaningful name can make scripts more readable. For example, set the
+     *  value of a button to submit_button rather than b1 or button1.

+     */
+    public function get id():String
+    {
+        return _id;
+    }
+
+    /**
+     *  @private
+     */
+    public function set id(value:String):void
+    {
+        _id = value;
+    }
+
+    //----------------------------------
+    //  isDocument
+    //----------------------------------
+
+    /**
+     *  Determines whether this UIComponent instance is a document object,
+     *  that is, whether it is at the top of the hierarchy of a Flex
+     *  application, MXML component, or ActionScript component.
+     */
+    public function get isDocument():Boolean
+    {
+        return document == this;
+    }
+
+    //----------------------------------
+    //  parentApplication
+    //----------------------------------
+
+    [Bindable("initialize")]
+
+    /**
+     *  A reference to the Application object that contains this UIComponent
+     *  instance.
+     *  This Application object might exist in a SWFLoader control in another
+     *  Application, and so on, creating a chain of Application objects that
+     *  can be walked using parentApplication.
+     *  The parentApplication property of an Application is never itself;
+     *  it is either the Application into which it was loaded or null
+     *  (for the top-level Application).
+     *  Walking the application chain using the parentApplication
+     *  property is similar to walking the document chain using the
+     *  parentDocument property.
+     *  You can access the top-level application using the
+     *  application property of the Application class.
+     */
+    /*
+     *  Note:
+     *  There are two reasons that 'parentApplication' is typed as Object
+     *  rather than as Application. The first is that typing it as Application
+     *  would make UIComponent dependent on Application, slowing down compile
+     *  times not only for SWCs for also for MXML and AS components. The
+     *  second is that authors would not be able to access properties and
+     *  methods in the


Transferred from the Adobe Open Source Subversion Repository

Revision: 8031
Author:   egeorgie@adobe.com
Date:     2009-06-20T01:10:03.288554Z

Log Message:
-----------
Scrub the TODOs in the framework, convert to FIXMEs in the new convention and assigning an owner.

Doc Notes: N/A
Bugs: N/A
Reviewer: Deepa
tests: build, checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/layouts/WheelLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/FadeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Timeline.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AddAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Scale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Rotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/mediaClasses/VolumeBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/DropDownController.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ModifiedCollectionView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ErrorSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Move.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/MoveInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/SequenceInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/EffectTargetFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransformInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/RemoveAction.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/utils/BitmapUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/FocusSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/CompositeEffect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/MotionPath.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/MatrixUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/supportClasses/LayoutElementHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/mediaClasses/StreamingVideoSource.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/effectClasses/PropertyChanges.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ToggleButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/RemoveActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layouts/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/pathSegments/LineSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AnimateTransitionShaderInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/SimpleText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262899 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/utils/MatrixUtil.as
+++ frameworks/projects/framework/src/mx/utils/MatrixUtil.as
@@ -208,7 +208,7 @@
         else
             t1 = Math.atan((d * ry) / (b * rx));

-        // TODO EGeorgie: optimize
+        // FIXME (egeorgie): optimize
         var x1:Number = a * Math.cos(t) * rx + c * Math.sin(t) * ry;
         var x2:Number = -x1;
         x1 += a * cx + c * cy + matrix.tx;
@@ -307,7 +307,7 @@
 	 */
 	public static function transformSize(bounds:Point, matrix:Matrix):Point
 	{
-		// TODO EGeorgie: don't use new points, but do the math ourselves?
+		// FIXME (egeorgie): don't use new points, but do the math ourselves?
 	    var pt1:Point = matrix.deltaTransformPoint(bounds);
 	    var pt2:Point = matrix.deltaTransformPoint(new Point());
 	    var pt3:Point = matrix.deltaTransformPoint(new Point(bounds.x, 0));
@@ -340,7 +340,7 @@
 	 */
 	public static function transformBounds(bounds:Point, matrix:Matrix, topLeft:Point = null):Point
 	{
-		// TODO EGeorgie: don't use new points, but do the math ourselves?
+		// FIXME (egeorgie): don't use new points, but do the math ourselves?
 		var x:Number = 0;
 		var y:Number = 0;