flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [12/42] flex-asjs git commit: And here’s TLF…
Date Thu, 16 Mar 2017 13:37:32 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEvent.as
new file mode 100644
index 0000000..c3083dc
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEvent.as
@@ -0,0 +1,216 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.MouseEvent;
+	import org.apache.flex.textLayout.elements.IFlowElement;
+			
+	/** A link element dispatches this event when it detects mouse activity.
+	 * The Text Layout Framework includes this special version of mouse events
+	 * because mouse events are generally unwanted when a flow element is
+	 * embedded in an editable text flow, and because link elements are not in
+	 * the display list (they are not DisplayObjects).
+	 * <p>You can add an event listener to a link element to listen for this
+	 * type of event. If you choose to cancel the event by calling
+	 * <code>Event.preventDefault()</code>, the default behavior associated
+	 * with the event will not occur.
+	 * </p>
+	 * <p>If you choose not to add an event listener to the link element, or
+	 * your event listener function does not cancel the behavior, the 
+	 * event is again dispatched, but this time by the link element's
+	 * associated TextFlow instance rather than by the link element itself. 
+	 * This provides a second opportunity to listen for this event with
+	 * an event listener attached to the TextFlow. 
+	 * </p>
+	 * <p>FlowElementMouseEvents are
+	 * dispatched only when the text cannot be edited or when the control key 
+	 * is pressed concurrently with the mouse activity.</p>
+	 * <p>
+	 * The following six event types are dispatched only when the text
+	 * cannot be edited or when the control key is pressed:
+	 * <ul>
+	 *   <li><code>FlowElementMouseEvent.CLICK</code></li>
+	 *   <li><code>FlowElementMouseEvent.MOUSE_DOWN</code></li>
+	 *   <li><code>FlowElementMouseEvent.MOUSE_UP</code></li>
+	 *   <li><code>FlowElementMouseEvent.MOUSE_MOVE</code></li>
+	 *   <li><code>FlowElementMouseEvent.ROLL_OVER</code></li>
+	 *   <li><code>FlowElementMouseEvent.ROLL_OUT</code></li>
+	 * </ul>
+	 * </p>
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 * @see org.apache.flex.textLayout.elements.LinkElement
+     * @see org.apache.flex.events.MouseEvent
+	 */
+	public class FlowElementMouseEvent extends Event
+	{
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>mouseDown</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#MOUSE_DOWN
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const MOUSE_DOWN:String = "mouseDown";
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>mouseUp</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#MOUSE_UP
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const MOUSE_UP:String = "mouseUp";	
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>mouseMove</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#MOUSE_MOVE
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const MOUSE_MOVE:String = "mouseMove";
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>rollOver</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#ROLL_OVER
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const ROLL_OVER:String = "rollOver";
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>rollOut</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#ROLL_OUT
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const ROLL_OUT:String = "rollOut";	
+		/**
+		 * Defines the value of the <code>type</code> property of a <code>click</code> event object. 
+		 * 
+		 * @see org.apache.flex.events.MouseEvent#CLICK
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const CLICK:String = "click";
+
+		private var _flowElement:IFlowElement;
+		private var _originalEvent:MouseEvent;
+		
+		/** 
+		 * The FlowElement that dispatched the event.
+		 *
+		 * @see org.apache.flex.textLayout.elements.FlowElement
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function get flowElement():IFlowElement
+		{ return _flowElement; }		
+		public function set flowElement(value:IFlowElement):void
+		{ _flowElement = value; }
+		
+		/** 
+		 * The original mouse event generated by the mouse activity. 
+		 * This property can contain any of the following values:
+		 * <ul>
+		 *   <li><code>MouseEvent.CLICK</code></li>
+		 *   <li><code>MouseEvent.MOUSE_DOWN</code></li>
+		 *   <li><code>MouseEvent.MOUSE_UP</code></li>
+		 *   <li><code>MouseEvent.MOUSE_MOVE</code></li>
+		 *   <li><code>MouseEvent.MOUSE_OVER</code></li>
+		 *   <li><code>MouseEvent.MOUSE_OUT</code></li>
+		 * </ul>
+		 * <p>
+		 * In most cases the original event matches the event that the
+		 * link element dispatches. The events match for the <code>click</code>,
+		 * <code>mouseDown</code>, <code>mouseOut</code>, and <code>mouseOver</code>
+		 * events. There are two cases, however, in which the original event
+		 * is converted by the link element to a related event. 
+		 * If a link element detects a <code>mouseOver</code> event, it dispatches
+		 * a <code>rollOver</code> event. Likewise, if a link element detects
+		 * a <code>mouseOut</code> event, it dispatches a <code>rollOut</code> event.
+		 * Usually, the event target and the mouse coordinates are related to
+		 * the TextLine instance containing the link element.
+		 * </p>
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 * @see org.apache.flex.events.MouseEvent
+		 */
+		public function get originalEvent():MouseEvent
+		{ return _originalEvent; }		
+		public function set originalEvent(value:MouseEvent):void
+		{ _originalEvent = value; }
+				
+		/** 
+		 * Creates an event object that contains information about mouse activity.
+		 * Event objects are passed as parameters to event listeners. Use the
+		 * constructor if you plan to manually dispatch an event. You do not need
+		 * to use the constructor to listen for FlowElementMouseEvent objects
+		 * generated by a FlowElement.
+		 * @param type  The type of the event. Event listeners can access this information through the
+		 * inherited <code>type</code> property. There are six types:
+		 * <code>FlowElementMouseEvent.CLICK</code>; <code>FlowElementMouseEvent.MOUSE_DOWN</code>; <code>FlowElementMouseEvent.MOUSE_MOVE</code>;
+		 * <code>FlowElementMouseEvent.MOUSE_UP</code>; <code>FlowElementMouseEvent.ROLL_OVER</code>; and <code>FlowElementMouseEvent.ROLL_OUT</code>.
+		 * @param bubbles Determines whether the Event object participates in the bubbling phase of the
+		 * event flow. FlowElementMouseEvent objects do not bubble.
+		 * @param cancelable Determines whether the Event object can be canceled. Event listeners can
+		 * access this information through the inherited <code>cancelable</code> property. FlowElementMouseEvent
+		 * objects can be cancelled. You can cancel the default behavior associated with this event
+		 * by calling the <code>preventDefault()</code> method in your event listener.
+		 * @param flowElement The instance of FlowElement, currently a LinkElement, associated with this
+		 * event. Event listeners can access this information through the <code>flowElement</code> property.
+		 * @param originalEvent The original mouse event that occurred on the flowElement. Event listeners can 
+		 * access this information through the <code>originalEvent</code> property.
+
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function FlowElementMouseEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = true, flowElement:IFlowElement = null, originalEvent:MouseEvent = null)
+		{
+			super(type, bubbles, cancelable);
+			_flowElement = flowElement;
+			_originalEvent = originalEvent;
+        }
+        
+        /** @private */
+        override public function cloneEvent():IFlexJSEvent
+        {
+        	return new FlowElementMouseEvent(type, bubbles, cancelable, flowElement, originalEvent);
+        }
+        
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
new file mode 100644
index 0000000..855dc12
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowElementMouseEventManager.as
@@ -0,0 +1,732 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.KeyboardEvent;
+	import org.apache.flex.events.MouseEvent;
+	import org.apache.flex.geom.Point;
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.textLayout.container.IContainerController;
+	import org.apache.flex.textLayout.container.ScrollPolicy;
+	import org.apache.flex.textLayout.debug.assert;
+	import org.apache.flex.textLayout.elements.IFlowGroupElement;
+	import org.apache.flex.textLayout.elements.IFlowElement;
+	import org.apache.flex.textLayout.elements.ITextFlow;
+	import org.apache.flex.textLayout.elements.ILinkElement;
+	import org.apache.flex.textLayout.elements.TextRange;
+	import org.apache.flex.textLayout.formats.BlockProgression;
+	import org.apache.flex.textLayout.utils.GeometryUtil;
+	import org.apache.flex.textLayout.utils.HitTestArea;
+	import org.apache.flex.utils.ObjectMap;
+
+
+	
+	// [ExcludeClass]
+	/**
+	 * The ElementMouseEventManager class provides mouse element processing for visible
+	 * FlowElements. The caller calls updateHitTests(), which traverses the FlowElement
+	 * tree in the given character range, and collects hit test rectangles for FlowElements 
+	 * with active event mirrors, and LinkElements. The latter class exposes a number of
+	 * mouse event handlers that this class calls directly. If no character range is
+	 * supplied, the class makes an educated guess about the visible character range by 
+	 * inspecting the TextLine instances connected to the container widget as children.
+	 * 
+	 * In edit mode, moving the mouse over the element and clicking it should not activate
+	 * it, but rather allow for editing. Passing in the value true as an argument
+	 * to updateHitTests() requires the Ctrl key to be held down in order to pass mouse 
+	 * events on the FlowElements. If the user presses or releases the Ctrl key while the
+	 * mouse is over the container widget (and the pressing of the Ctrl key is required
+	 * for activation, the class simulates mouseOut and mouseOver events to inform the 
+	 * FlowElement underneath about the change. The class dispatches only FlowElementMouseEvents.
+	 * 
+	 * This class emits click events if the main mouse button is pressed and released over the
+	 * same FlowElement.
+	 * 
+	 * The owner may choose to forward several mouse and keyboard events to this class so it
+	 * does not need to listen to these events at the container itself. The constructor takes
+	 * an array of event names that this class needs to listen to itself. The events that this
+	 * class needs to listen to are MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_OUT, MouseEvent.MOUSE_DOWN,
+	 * MouseEvent.MOUSE_UP, MouseEvent.MOUSE_MOVE, KeyboardEvent.KEY_DOWN, and KeyboardEvent.KEY_UP.
+	 * Note that MouseEvent.CLICK is not needed.
+	 */
+	public class FlowElementMouseEventManager
+	{
+		// The container that emits the mouse events, and that contains the TextLines as children.
+		private var _container:IParentIUIBase;
+		// the hit test rectangles if there is anything to hit test.
+		private var _hitTests:HitTestArea = null;
+		// The current element that has been identified as being hit.
+		private var _currentElement:IFlowElement = null;
+		// The element that has received the last museDown event.
+		private var _mouseDownElement:IFlowElement = null;
+		// If true, the Ctrl key is needed to send mouse events to a FlowElement.
+		private var _needsCtrlKey:Boolean = false;
+		// Reflects the state of the Ctrl key.
+		private var _ctrlKeyState:Boolean = false;
+		// The last mouse event serves as a template for fake mouse events (x, y, buttonDown)
+		private var _lastMouseEvent:MouseEvent = null;
+		/**
+		 * @private
+		 * Applies only if Ctrl key is needed: if the mouse entered the FlowElement
+		 * with the button wodn and the Ctrl key down, ignore the state of the Ctrl
+		 * key and treat it as not set. You do not want any reaction if the FlowElement
+		 * was e.g. entered during a mark operation.
+		 */
+		private var _blockInteraction:Boolean = false;
+		// Owner handles the event and calls dispatchEvent()
+		private const OWNER_HANDLES_EVENT:int = 0;
+		// This instance handles the event, but no event listener is registered.
+		private const THIS_HANDLES_EVENT:int = 1;
+		// This instance handles the event, and an an event listener is registered with the container/stage.
+		private const THIS_LISTENS_FOR_EVENTS:int = 2;
+		/** @private
+		 * This object contains the event states that this class must
+		 * register on its own behalf. The property name is the event name, 
+		 * and the property value is one of the above three constants.
+		 */
+		private var _eventListeners:Object;
+		/** @private
+		 * This object contains objects that hold a bounding rectangle in its "rect",
+		 * and a FlowElement in its "owner" property. The key is the toString() value
+		 * of the rectangle. Every time updateHitTests() is called, the object is 
+		 * checked for rectangles that still intersect with a given clip area, and 
+		 * these rectangles are removed from the object before the new rectangles 
+		 * are added. After that, the new hit test structure is built using this 
+		 * object. The code that adds rectangles uses the key to store rectangles
+		 * so updated rectangles are neatly overwritten.
+		 */
+		private var _hitRects:Object = null;
+		/**
+		 * The constructor needs the container that contains the TextLines to be checked
+		 * for visible, clicked elements. The container is also used as the event dispatcher 
+		 * for mouse events.
+		 * 
+		 * @param	container		The container holding the TextLines and emitting mouse events
+		 * @param	eventNames		An array of event names that the owner supplies itself.
+		 */
+		public function FlowElementMouseEventManager(container:IParentIUIBase, eventNames:Array)
+		{
+			_container = container;
+			_eventListeners = {};
+			_eventListeners[MouseEvent.MOUSE_OVER] =
+			_eventListeners[MouseEvent.MOUSE_OUT] =
+			_eventListeners[MouseEvent.MOUSE_DOWN] =
+			_eventListeners[MouseEvent.MOUSE_UP] =
+			_eventListeners[MouseEvent.MOUSE_MOVE] =
+			_eventListeners[KeyboardEvent.KEY_DOWN] =
+			_eventListeners[KeyboardEvent.KEY_UP] = THIS_HANDLES_EVENT;
+			// change the state for any event that the owner will supply
+			for each (var name:String in eventNames)
+				_eventListeners[name] = OWNER_HANDLES_EVENT;
+		}
+		
+		/**
+		 * Convert local mouse event coordinates, which are relative to the container
+		 * or one of its children (the event's target is the current element) to
+		 * container coordinates.
+		 * 
+		 * TODO: This is temporary code.
+		 * 
+		 * @param	evt				The mouse event containing the point to be converted.
+		 * @return					A new Point instance containing the converted coordinates.
+		 */
+		public function mouseToContainer(evt:MouseEvent):Point
+		{
+			// we have to use localX and localY because the UnitTests generate
+			// fake mouse events that are relative to a TextLine
+			var obj:Object = evt.target;
+			CONFIG::debug { assert(obj != null, "Event target is not a DisplayObject"); }
+			var containerPoint:Point = new Point(evt.localX, evt.localY);
+			while (obj != _container)
+			{
+//TODO resolve matrices
+//				var m:Matrix = obj.transform.matrix;
+//				containerPoint.offset(m.tx, m.ty);
+				containerPoint.offset(obj.x, obj.y);
+				// TextLines sometimes do not have a parent for some reason
+				obj = obj.parent;
+				if (!obj)
+					break;
+			}
+			return containerPoint;
+		}
+		
+		/**
+		 * Retrieve the status of the flag that controls whether the Ctrl key is needed
+		 * to activate event generation.
+		 */
+		public function get needsCtrlKey():Boolean
+		{
+			return _needsCtrlKey;
+		}
+		
+		/**
+		 * Set the status of the flag that controls whether the Ctrl key is needed
+		 * to activate event generation.
+		 */
+		public function set needsCtrlKey(k:Boolean):void
+		{
+			_needsCtrlKey = k;
+		}
+		
+		/**
+		 * Create an array of all FlowElements that are currently visible and that have an active
+		 * event mirror, plus all LinkElements by default, and update the hit test area for these
+		 * FlowElements. Clip the elements against the given clipping rectangle. All coordinates 
+		 * are assumed to be container coordinates.
+		 * 
+		 * <p>If the start index is -1 and or the end index is -1, the method attempts to make an educated 
+		 * guess about the visible part of the text by inspecting the visible TextLine instances, and
+		 * using their textBlockBeginIndex values as character offsets into the TextFlow tree. Note that
+		 * this method may be slow if the container contains an entire tree of DisplayObjects, because
+		 * the tree must be scanned recursively. It is always better to supply the start and end positions.</p>
+		 * 
+		 * @param	clipRect		The clipping rectangle, in container coordinates.
+		 * @param	textFlow		The TextFlow instance containing the elements to be tracked
+		 * @param	startPos		The character start position. If -1, the method attempts to
+		 * 							determine the first visible character.
+		 * @param	endPos			The character end position. If -1, the method attempts to
+		 * 							determine the last visible character.
+		 * @param	needsCtrlKey	If true, the event handler does not emit events unless
+		 * 							the Ctrl key is down. If the text is editable, simple clicks 
+		 * 							and moves should remain in the container rather than be
+		 * 							forwarded to the element.
+		 */
+		public function updateHitTests(xoffset:Number, clipRect:Rectangle, 
+									  textFlow:ITextFlow,
+									  startPos:int, endPos:int, 
+									   container:IContainerController,
+									  needsCtrlKey:Boolean=false):void
+		{
+			_needsCtrlKey = needsCtrlKey;
+			
+			var rect:Rectangle;
+			var obj:Object;
+			
+			var elements:Array = [];
+			if (textFlow.interactiveObjectCount != 0 && startPos != endPos)	// check for empty container
+			{
+				//New algorithm here to improve performance when there are link elements 
+				var uniqueDictionary:ObjectMap = container.interactiveObjects;
+				var o:Object ;
+				var f:IFlowElement;
+				for each (o in uniqueDictionary)
+				{
+					f = o as IFlowElement ;
+					if (f && f.getAbsoluteStart() < endPos && f.getAbsoluteStart() + f.textLength >= startPos)
+						elements.push(o) ;
+				}
+				//ensure there is no bug when you paste many words, which causes the link across containers
+				var interactiveObjects_LastTime:Array = container.oldInteractiveObjects;
+				for each (o in interactiveObjects_LastTime)
+				{
+					f = o as IFlowElement ;
+					if (f && f.getAbsoluteStart() < endPos && f.getAbsoluteStart() + f.textLength >= startPos)
+					{
+						elements.push(o) ;
+						uniqueDictionary[o] = o;//push back the interactive object, make sure the total number is correct 
+					}
+					
+				}
+				
+				CONFIG::debug
+				{
+					if (elements.length)
+					{
+						for each (var elem:IFlowElement in elements)
+						{
+							// trace(startPos,endPos,elem.defaultTypeName,elem.getAbsoluteStart(),elem.textLength);
+							assert(elem.getAbsoluteStart() < endPos,"updateHitTests bad absoluteStart");
+							assert(elem.getAbsoluteStart()+elem.textLength >= startPos,"updateHitTests bad absoluteEnd"); 
+						}
+					}
+				}
+			}
+			
+			var newHitRects:Object;
+			var rectCount:int = 0;
+			
+			if (elements.length != 0)
+			{		
+				newHitRects = {};
+	
+				for each (var element:IFlowElement in elements)
+				{
+					var elemStart:int = element.getAbsoluteStart();
+					var elemEnd:int = Math.min(elemStart + element.textLength, endPos);
+					var tf:ITextFlow = element.getTextFlow();
+					//Previously make sure the textflow of element is not null. No logic changes within the curly braces below.
+					if(tf)
+					{
+						var elemRects:Array = GeometryUtil.getHighlightBounds(new TextRange(tf, elemStart, elemEnd));
+						// this is an array of objects with textLine and rect properties
+						// Create an array of rectangle and owner objects to feed into a HitTestArea
+						for each (obj in elemRects)
+						{
+							rect = obj.rect;
+							//Fix for bug#2990689, handle the blockProgression == RL and direction == RTL case
+							var leftEdge:Number = clipRect.x;
+							var topEdge:Number = clipRect.y;
+													
+							//Fix for bug#2990689, 1st step:
+							//			When the blockProgression == RL and scrollPolicy.OFF case,
+							//			There will be a left/top adjust in ContainerController.fillShapeChildren()
+							//			The code change tried to find the real left boundary of container
+							//			by equalizing the adjustment in ContainerController.fillShapeChildren()
+							var wmode:String = element.computedFormat.blockProgression;
+							var adjustLines:Boolean = false;
+													
+							adjustLines = (wmode == BlockProgression.RL) &&
+								(container.horizontalScrollPolicy == ScrollPolicy.OFF && 
+									container.verticalScrollPolicy == ScrollPolicy.OFF);
+							if (adjustLines)
+							{
+								var width:Number = container.measureWidth? clipRect.width: container.compositionWidth;
+								leftEdge = clipRect.x - width + container.horizontalScrollPosition + clipRect.width;
+							}
+							
+							//Fix for bug#2990689, 2nd step:
+							//			When the direction == RTL case, the left/top edge of he text boundary will be the 
+							//			text width to the right edge rather than
+							//			the left boundary of container.
+							//			The code change tried to find the real left/top boundary of container
+							//			by setting the leftEdge to be the container's x and the topEdge to be container's y
+							if(wmode == BlockProgression.TB)
+							{
+								leftEdge = 0;
+								topEdge = 0;
+							}
+							else
+							{
+								topEdge = 0;
+							}
+													
+							rect.x = leftEdge + obj.textLine.x + rect.x + xoffset;
+							rect.y = topEdge + obj.textLine.y + rect.y;
+							//Fix for bug#2990689 end
+							// Only use the visible parts of the rectangle if any
+							rect = rect.intersection(clipRect);
+							if (!rect.isEmpty())
+							{
+								// use integer rectangles for better toString() representation
+								// this decreases the number of stored rectangles due to FP errors
+								rect.x = int(rect.x);
+								rect.y = int(rect.y);
+								rect.width = int(rect.width);
+								rect.height = int(rect.height);
+								var name:String = rect.toString();
+								var oldObj:Object = newHitRects[name];
+								if (!oldObj || oldObj.owner != element)
+								{
+									// replace or add operation
+									newHitRects[name] = { "rect": rect, "owner": element };
+									rectCount++;
+								}
+							}
+						}
+					}
+				}
+			}
+
+			if (rectCount > 0)
+			{
+				if (!_hitTests)
+					startHitTests();
+				_hitRects = newHitRects;
+				_hitTests = new HitTestArea(newHitRects);
+			}
+			else
+				stopHitTests();
+		}
+		
+		/** @private Start hit testing. */
+		public function startHitTests():void
+		{
+			_currentElement = null;
+			_mouseDownElement = null;
+			_ctrlKeyState = false;
+			// conditionally attach required event listeners
+			addEventListener(MouseEvent.MOUSE_OVER, false);
+			addEventListener(MouseEvent.MOUSE_OUT, false);
+			addEventListener(MouseEvent.MOUSE_DOWN, false);
+			addEventListener(MouseEvent.MOUSE_UP, false);
+			addEventListener(MouseEvent.MOUSE_MOVE, false);
+		}
+		
+		/**
+		 * Stop hit testing altogether. You must call this method if the
+		 * FlowElement structure of the visible area has changed; you should
+		 * also call this method if the visible area is rebuilt completely.
+		 */
+		public function stopHitTests():void
+		{
+			// conditionally remove required event listeners
+			removeEventListener(MouseEvent.MOUSE_OVER, false);
+			removeEventListener(MouseEvent.MOUSE_OUT, false);
+			removeEventListener(MouseEvent.MOUSE_DOWN, false);
+			removeEventListener(MouseEvent.MOUSE_UP, false);
+			removeEventListener(MouseEvent.MOUSE_MOVE, false);
+			removeEventListener(KeyboardEvent.KEY_DOWN, true);
+			removeEventListener(KeyboardEvent.KEY_UP, true);
+			_hitRects = null;
+			_hitTests = null;
+			_currentElement = null;
+			_mouseDownElement = null;
+			_ctrlKeyState = false;
+		}
+		
+		private function addEventListener(name:String, kbdEvent:Boolean = false):void
+		{
+			if (_eventListeners[name] === THIS_HANDLES_EVENT)
+			{
+				var target:IUIBase;
+				var listener:Function;
+				if (kbdEvent)
+				{
+//TODO
+//					target = _container.stage;
+//					if (!target)
+						target = _container;
+					listener = hitTestKeyEventHandler;
+				}
+				else
+				{
+					target = _container;
+					listener = hitTestMouseEventHandler;
+				}
+				target.addEventListener(name, listener, false, 1);
+				_eventListeners[name] = THIS_LISTENS_FOR_EVENTS;
+			}
+		}
+		
+		private function removeEventListener(name:String, kbdEvent:Boolean):void
+		{
+			if (_eventListeners[name] === THIS_LISTENS_FOR_EVENTS)
+			{
+				var target:IUIBase;
+				var listener:Function;
+				if (kbdEvent)
+				{
+//TODO
+//					target = _container.stage;
+//					if (!target)
+						target = _container;
+					listener = hitTestKeyEventHandler;
+				}
+				else
+				{
+					target = _container;
+					listener = hitTestMouseEventHandler;
+				}
+				target.removeEventListener(name, listener);
+				_eventListeners[name] = THIS_HANDLES_EVENT;
+			}
+		}
+
+		/**
+		 *  @private
+		 * Collect all FlowElements with an active event mirror plus all LinkElements in to the given
+		 * array. This method is recursive so it can iterate over child FlowElements.
+		 * 
+		 * @param	parent		The parent element to scan.
+		 * @param	startPosition	The starting character position.
+		 * @param	endPosition	The ending character position.
+		 * @param	results		The array to fill with FlowElements that match.
+		 * @flexjsignorecoercion org.apache.flex.textLayout.elements.IFlowGroupElement
+		 */
+		public function collectElements(parent:IFlowGroupElement, startPosition:int, endPosition:int, results:Array):void
+		{
+			CONFIG::debug { assert(startPosition >= 0,"Bad startPosition parameter"); }
+			CONFIG::debug { assert(endPosition >= startPosition,"Bad endPosition parameter"); }
+
+			var i:int = parent.findChildIndexAtPosition(startPosition);
+			for (; i < parent.numChildren; i++)
+			{
+				var child:IFlowElement = parent.getChildAt(i);
+				if (child.parentRelativeStart >= endPosition)
+					// behind end
+					break;
+				if (child.hasActiveEventMirror() || (child is ILinkElement))
+					results.push(child);
+				var group:IFlowGroupElement = child as IFlowGroupElement;
+				if (group)
+					collectElements(group, Math.max(startPosition-group.parentRelativeStart,0), endPosition-group.parentRelativeStart, results);
+			}
+		}
+		
+		/**
+		 * Dispatch the mouse and keyboard events that the owner sends.
+		 */
+		public function dispatchEvent(evt:Event):void
+		{
+			var mouseEvt:MouseEvent = evt as MouseEvent;
+			if (mouseEvt)
+				hitTestMouseEventHandler(mouseEvt);
+			else
+			{
+				var keyEvt:KeyboardEvent = evt as KeyboardEvent;
+				if (keyEvt)
+					hitTestKeyEventHandler(keyEvt);
+			}
+		}
+		
+		/** @private
+		 * Process the key down/key up messages for the Ctrl key. This handler
+		 * is required to make a visual change for the element if the Ctrl key is
+		 * pressed or released while not moving the mouse. If a Ctrl key change
+		 * is detected, and the owner signalled that the Ctrl key is required,
+		 * there will be a mouseOver element if the Ctrl key is pressed, and a
+		 * mouseOut event if the Ctrl key is released.
+		 */
+		private function hitTestKeyEventHandler(evt:KeyboardEvent):void
+		{
+			if (!_blockInteraction)
+				checkCtrlKeyState(evt.ctrlKey);
+		}
+		
+		/**
+		 * @flexjsignorecoercion org.apache.flex.textLayout.elements.ILinkElement
+		 */
+		private function checkCtrlKeyState(curState:Boolean):void
+		{
+			// currently, support only LinkElements
+			var link:ILinkElement = _currentElement as ILinkElement;
+			// do nothing if the Ctrl key is not needed, or the key state did not change
+			// we also need the last mouse event for the button state to pass in to the link
+			if(!link || !_needsCtrlKey || !_lastMouseEvent || (curState == _ctrlKeyState))
+				return;
+			_ctrlKeyState = curState;
+
+			// the event type is irrelevant here - only the buttonDown state is relevant
+			if (_ctrlKeyState)
+				link.mouseOverHandler(this, _lastMouseEvent);
+			else
+				link.mouseOutHandler(this, _lastMouseEvent);
+		}
+		
+		/** @private
+		 * Process mouse events.
+		 * 
+		 * For event mirroring, hasActiveEventMirror() must be true; if so, the event mirror
+		 * dispatches a FlowElementMouseEvent. The method generates fake rollOut and rollOver
+		 * events; the original mouseOut and mouseOver events are container and/or TextLine events.
+		 */		
+		private function hitTestMouseEventHandler(evt:MouseEvent):void
+		{
+			if (!_hitTests)
+				return;
+			
+			// note that mouseOver and mouseOut are used for hit-testing only
+			// need the last mouse event's button state to pass in to LinkElement
+			// in case the state of the Ctrl key changes (see hitTestKeyEventHandler())
+			_lastMouseEvent = evt;
+			
+			var containerPoint:Point = mouseToContainer(evt);
+			var hitElement:IFlowElement = _hitTests.hitTest(containerPoint.x, containerPoint.y);
+			if (hitElement != _currentElement)
+			{
+				_mouseDownElement = null;
+				if (_currentElement)
+					// generate a mouseOut event
+					localDispatchEvent(FlowElementMouseEvent.ROLL_OUT, evt);
+				else if (evt.buttonDown)
+					// do not interact if the button is down to not disturb e.g. 
+					// a mark operation in the container
+					_blockInteraction = true;
+				_currentElement = hitElement;
+				if (_currentElement)
+					// generate a mouseOver event
+					localDispatchEvent(FlowElementMouseEvent.ROLL_OVER, evt);
+				else
+					// no FlowElement underneathmouse: reset interaction blocker
+					_blockInteraction = false;
+			}
+
+			var isClick:Boolean = false;
+			var eventType:String = null;
+			switch (evt.type)
+			{
+				case MouseEvent.MOUSE_MOVE:
+					eventType = FlowElementMouseEvent.MOUSE_MOVE;
+					// Need to check the state of the event's Ctrl key in case
+					// the container lost focus, and the mouse was moved
+					if (!_blockInteraction)
+						checkCtrlKeyState(evt.ctrlKey);
+					break;
+				case MouseEvent.MOUSE_DOWN: 
+					_mouseDownElement = _currentElement;
+					eventType = FlowElementMouseEvent.MOUSE_DOWN;
+					break;
+				case MouseEvent.MOUSE_UP:
+					eventType = FlowElementMouseEvent.MOUSE_UP;
+					isClick = (_currentElement == _mouseDownElement);
+					_mouseDownElement = null;
+					break;
+			}
+			
+			if (_currentElement && eventType)
+			{
+				localDispatchEvent(eventType, evt);
+				if (isClick)
+					localDispatchEvent(FlowElementMouseEvent.CLICK, evt);
+			}
+		}
+		
+		/** @private
+		 * Dispatch a FlowElementMouseEvent with the given type. First, attempt to
+		 * dispatch to an event mirror if attached and listening. If there was nobody
+		 * listening at the event mirror, or the event did not stop propagation, dispatch
+		 * the event to the TextFlow as well.
+		 * 
+		 * @param	type			The event type, should be a constant defind in FlowElementMouseEvent.
+		 * @param	originalEvent	The original mouse event.
+		 * @return					true if the event was dispatched and shgould not be distributed further.
+		 */
+		public function dispatchFlowElementMouseEvent(type:String, originalEvent:MouseEvent):Boolean
+		{
+			// Mimick old behavior, and emit only rollOut events if Ctrl key is not down
+			if (_needsCtrlKey && !originalEvent.ctrlKey && type != FlowElementMouseEvent.ROLL_OUT)
+				return false;
+			
+			var locallyListening:Boolean = _currentElement.hasActiveEventMirror();
+			var textFlow:ITextFlow = _currentElement.getTextFlow();
+			var textFlowListening:Boolean = false;
+			if (textFlow)
+				textFlowListening = textFlow.hasEventListener(type);
+			if (!locallyListening && !textFlowListening)
+			{
+				return false;
+			}
+			
+			var event:FlowElementMouseEvent = new FlowElementMouseEvent(type, false, true, _currentElement, originalEvent);
+			if (locallyListening)
+			{
+				_currentElement.getEventMirror().dispatchEvent(event);
+				if (event.isDefaultPrevented())
+					return true;
+			}
+			if (textFlowListening)
+			{
+				textFlow.dispatchEvent(event);
+				if (event.isDefaultPrevented())
+					return true;
+			}
+			return false;
+		}
+		
+		/** @private
+		 * Dispatch a FlowElementMouseEvent, and call the correct LinkElement
+		 * event handler if the current element is a LinkElement.
+		 * 
+		 * LinkElements implement several mouse handlers; these are called directly
+		 * so LinkElements do not needs to register themselves with their own 
+		 * event mirror.
+		 * @flexjsignorecoercion org.apache.flex.textLayout.elements.ILinkElement
+		 */
+		
+		private function localDispatchEvent(type:String, evt:MouseEvent):void
+		{
+			if (_blockInteraction || !_currentElement)
+				return;
+			
+			// Attach or detach listeners for the Ctrl key if needed
+			if (_needsCtrlKey)
+				switch (type)
+			{
+				case FlowElementMouseEvent.ROLL_OVER:
+					addEventListener(KeyboardEvent.KEY_DOWN, true);
+					addEventListener(KeyboardEvent.KEY_UP, true);
+					break;
+				case FlowElementMouseEvent.ROLL_OUT:
+					removeEventListener(KeyboardEvent.KEY_DOWN, true);
+					removeEventListener(KeyboardEvent.KEY_UP, true);
+					break;
+			}
+			
+			if (dispatchFlowElementMouseEvent(type, evt))
+				return;
+			
+			// dispatch to a LinkElement only if Ctrl key conditions fit
+			var link:ILinkElement = (!_needsCtrlKey || evt.ctrlKey) ? (_currentElement as ILinkElement) : null;
+			if (!link)
+				return;
+			
+			// use the FlowElementMouseEvent type - the mouse event type may be unrelated
+			switch (type)
+			{
+				case FlowElementMouseEvent.MOUSE_DOWN: 
+					link.mouseDownHandler(this, evt); 
+					break;
+				case FlowElementMouseEvent.MOUSE_MOVE:
+					link.mouseMoveHandler(this, evt); 
+					break;
+				case FlowElementMouseEvent.ROLL_OUT:
+					link.mouseOutHandler(this, evt); 
+					break;
+				case FlowElementMouseEvent.ROLL_OVER:
+					link.mouseOverHandler(this, evt); 
+					break;
+				case FlowElementMouseEvent.MOUSE_UP:
+					link.mouseUpHandler(this, evt); 
+					break;
+				case FlowElementMouseEvent.CLICK:
+					link.mouseClickHandler(this, evt);
+					break;
+			}
+		}
+
+		/** @private
+		 * Utility method for LinkElement (and other elements in the future that
+		 * might implement the same mouse handlers) to set and reset the Hand cursor.
+		 */
+		public function setHandCursor(state:Boolean=true):void
+		{
+			if (_currentElement == null)
+				return;
+// state;
+//TODO set hand cursor
+			
+//			var tf:ITextFlow = _currentElement.getTextFlow();
+// 			if (tf != null && tf.flowComposer && tf.flowComposer.numControllers)
+// 			{
+//				var sprite:Sprite = _container as Sprite;
+//				if (sprite)
+//				{
+//					sprite.buttonMode = state;
+//					sprite.useHandCursor = state;
+//				}
+//				if (state)
+//					Mouse.cursor = MouseCursor.BUTTON;
+//				else
+//				{
+//					var wmode:String = tf.computedFormat.blockProgression;									
+//					if (tf.interactionManager && (wmode != BlockProgression.RL))
+//						Mouse.cursor = MouseCursor.IBEAM;
+//					else
+//						Mouse.cursor = Configuration.getCursorString(tf.configuration, MouseCursor.AUTO);
+//				}
+//				Mouse.hide();
+//				Mouse.show();
+//			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowOperationEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowOperationEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowOperationEvent.as
new file mode 100644
index 0000000..ee584fd
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FlowOperationEvent.as
@@ -0,0 +1,168 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.Event;
+	
+	import org.apache.flex.textLayout.operations.FlowOperation; 
+	
+	/** A TextFlow instance dispatches this event just before an operation commences
+	 * and again just after an operation completes. Although the event object
+	 * dispatched in both cases is an instance of FlowOperationEvent, the events
+	 * dispatched before and after an operation differ in significant ways.
+	 *
+	 * <p>Before any operation is carried out, a TextFlow object dispatches a FlowOperationEvent
+	 * with its <code>type</code> property set to <code>FlowOperationEvent.FLOW_OPERATION_BEGIN.</code>
+	 * You can determine what type of operation is about to commence by checking
+	 * the <code>operation</code> property. Events of type FLOW_OPERATION_BEGIN are
+	 * cancellable, which means that if you decide that the operation should not proceed,
+	 * you can call <code>Event.PreventDefault()</code> to cancel the operation.
+	 * If you cancel the operation, the operation is not performed and the 
+	 * FLOW_OPERATION_END event is not dispatched. You may also choose to call back into the
+	 * EditManager to do another operation before the operation that triggered the event is done. If you do
+	 * this, the operations you initiate in your event handler will be undone as a single
+	 * operation with the operation that triggered the event.</p>
+	 *
+	 * <p>If you allow the operation to proceed, TextFlow will dispatch a FlowOperationEvent
+	 * upon completion of the operation with its <code>type</code> property set to
+	 * <code>FlowOperationEvent.FLOW_OPERATION_END</code>. This event is dispatched
+	 * before Flash Player throws any errors that may have occurred as a result of the
+	 * operation. This gives you an opportunity to process the error before Flash Player
+	 * throws the error. You can access the error through the event's <code>error</code>
+	 * property. If you choose to handle the error in your event handler, you can prevent
+	 * Flash Player from throwing the error by cancelling the FLOW_OPERATION_END event
+	 * by calling <code>Event.preventDefault()</code>. You may also choose to call back into the
+	 * EditManager to do some additional operations. If you do this, the operations that result
+	 * will be undone as a unit with the operation that triggered the event.
+	 * </p> 
+	 *
+	 * @see org.apache.flex.textLayout.operations.FlowOperation
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 */
+	public class FlowOperationEvent extends Event
+	{
+		/** 
+		 * Defines the value of the <code>type</code> property of a <code>flowOperationBegin</code> event object.
+		 * Dispatched before an operation is executed.   Cancelling this event blocks the operation. 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		
+		public static const FLOW_OPERATION_BEGIN:String = "flowOperationBegin";
+		
+		/**  
+		 * Defines the value of the <code>type</code> property of a <code>flowOperationEnd</code> event object.
+		 * Dispatched after an operation completes. Any errors are stored in <code>OperationEvent.error</code>.
+	 	 * If there is an error, cancelling this event blocks the rethrow of the error.
+	 	 * Generally speaking all errors are likely to be fatal.
+	 	 * <p>Changing an operation at this time (after it has been executed) may fail.</p> 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+	 	 */
+	 	
+		public static const FLOW_OPERATION_END:String = "flowOperationEnd";
+
+		/**  
+		 * Defines the value of the <code>type</code> property of a <code>flowOperationComplete</code> event object.
+		 * Dispatched after all operations including pending and composite operations are completed, composition is finished and the display is scrolled.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		
+		public static const FLOW_OPERATION_COMPLETE:String = "flowOperationComplete";
+				
+		private var _op:FlowOperation;
+		private var _e:Error;
+		private var _level:int;
+
+		/** 
+		 * The operation that is about to begin or has just ended.
+		 * 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+	         * @see org.apache.flex.textLayout.operations.FlowOperation
+		 */		
+		public function get operation():FlowOperation
+		{ return _op; }	
+		public function set operation(value:FlowOperation):void
+		{ _op = value; }	
+
+		/** 
+		 * The error thrown, if any, during an operation.  
+		 * If an error occurs during an operation, a reference to the error object is attached to the 
+		 * FLOW_OPERATION_END event. This give you the opportunity to deal with the error
+		 * before Flash Player throws the error. If you cancel the event, Flash Player will not throw the error.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function get error():Error
+		{ return _e; }
+		public function set error(value:Error):void
+		{ _e = value; }
+		
+		/** 
+		 * Operations may be merged into composite operations through nesting.  This flag describes the nesting level of the operation.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function get level():int
+		{ return _level; }
+		public function set level(value:int):void
+		{ _level = value; }		
+		
+		/** Creates an event object that contains information about a flow operation.
+		 * @param type			The type of the event. Event listeners can access this information through the
+		 * inherited <code>type</code> property. There are two types: 
+		 * <code>FlowOperationEvent.FLOW_OPERATION_BEGIN</code>; 
+		 * <code>FlowOperationEvent.FLOW_OPERATION_END</code>.
+		 * @param bubbles 		Indicates whether an event is a bubbling event.This event does not bubble.
+		 * @param cancelable 	Indicates whether the behavior associated with the event can be prevented.
+		 * This event can be cancelled by calling the <code>Event.preventDefault()</code> method in
+		 * your event handler function.
+		 * @param operation		The FlowOperation that is about to commence or that has just ended.
+		 * @param error			Any Error generating during the operation.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function FlowOperationEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, operation:FlowOperation = null, level:int = 0, error:Error = null)
+		{
+			_op = operation;
+			_e  = error;
+			_level = level;
+			super(type, bubbles, cancelable);
+		}
+		
+       	/** @private */
+		override public function cloneEvent():IFlexJSEvent
+		{
+			return new FlowOperationEvent(type, bubbles, cancelable, _op, _level, _e);
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FocusEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FocusEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FocusEvent.as
new file mode 100644
index 0000000..45811c9
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/FocusEvent.as
@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events {
+
+	public class FocusEvent {
+
+		public static const FOCUS_IN:String = "focusIn";
+		public static const FOCUS_OUT:String = "focusOut";
+		public static const KEY_FOCUS_CHANGE:String = "keyFocusChange";
+		public static const MOUSE_FOCUS_CHANGE:String = "mouseFocusChange";
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ModelChange.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ModelChange.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ModelChange.as
new file mode 100644
index 0000000..4f0249f
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ModelChange.as
@@ -0,0 +1,38 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	
+	/** ModelChange values.  These are various types of model change. @private */
+	public final class ModelChange
+	{
+		public static const ELEMENT_ADDED:String    = "elementAdded";
+		public static const ELEMENT_REMOVAL:String  = "elementRemoval";
+		public static const ELEMENT_MODIFIED:String = "elementModified";		
+		
+		public static const TEXTLAYOUT_FORMAT_CHANGED:String = "formatChanged";
+		
+		public static const TEXT_INSERTED:String = "textInserted";
+		public static const TEXT_DELETED:String  = "textDeleted";
+		
+		public static const STYLE_SELECTOR_CHANGED:String = "styleSelectorChanged";
+		
+		public static const USER_STYLE_CHANGED:String = "userStyleChanged";
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEvent.as
new file mode 100644
index 0000000..6190f4d
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEvent.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.Event;
+	
+	/**
+	 *  Represents events that are dispatched when the TextFlow does automatic scrolling.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class ScrollEvent extends TextLayoutEvent
+	{
+		//--------------------------------------------------------------------------
+		//
+		// Constructor
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  Constructor.
+		 * 
+		 *  Scroll events are dispatched when a container has scrolled. 
+		 *
+		 *  @param type The event type; indicates the action that caused the event.
+		 *
+		 *  @param bubbles Specifies whether the event can bubble
+		 *  up the display list hierarchy.
+		 *
+		 *  @param cancelable Specifies whether the behavior associated with the event
+		 *  can be prevented.
+		 *
+		 *
+		 *  @param delta The change in scroll position, expressed in pixels.
+		 *  
+		 */
+		public function ScrollEvent(type:String, bubbles:Boolean = false,
+									cancelable:Boolean = false,
+									direction:String = null, delta:Number = NaN)
+		{
+			super(type, bubbles, cancelable);
+			
+			this.direction = direction;
+			this.delta = delta;
+		}
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Properties
+		//
+		//--------------------------------------------------------------------------
+		
+		//----------------------------------
+		//  delta
+		//----------------------------------
+		
+		/**
+		 *  The change in the scroll position value that resulted from 
+		 *  the scroll. The value is expressed in pixels. A positive value indicates the 
+		 *  scroll was down or to the right. A negative value indicates the scroll  
+		 * 	was up or to the left.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var delta:Number;
+		
+		//----------------------------------
+		//  direction
+		//----------------------------------
+		
+		/**
+		 *  The direction of motion.
+		 *  The possible values are <code>ScrollEventDirection.VERTICAL</code>
+		 *  or <code>ScrollEventDirection.HORIZONTAL</code>.
+		 *
+		 *  @see org.apache.flex.textLayout.events.ScrollEventDirection
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public var direction:String;
+		
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods: Event
+		//
+		//--------------------------------------------------------------------------
+		
+		/**
+		 *  @private
+		 */
+		override public function cloneEvent():IFlexJSEvent
+		{
+			return new ScrollEvent(type, bubbles, cancelable, direction, delta);
+		}
+	}
+	
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEventDirection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEventDirection.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEventDirection.as
new file mode 100644
index 0000000..f39033d
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/ScrollEventDirection.as
@@ -0,0 +1,59 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+    
+    /**
+     *  Constants for the values of the <code>direction</code> property
+     *  of a ScrollEvent.
+     *
+     *  @see org.apache.flex.textLayout.events.ScrollEvent
+     * 
+     * @playerversion Flash 10.0
+     * @playerversion AIR 2.0
+     * @langversion 3.0
+     */
+    public final class ScrollEventDirection
+    {
+        //--------------------------------------------------------------------------
+        //
+        //  Class constants
+        //
+        //--------------------------------------------------------------------------
+        
+        /**
+         *  The user scrolled horizontally.
+         * 
+         * @playerversion Flash 10.0
+         * @playerversion AIR 2.0
+         * @langversion 3.0
+         */
+        public static const HORIZONTAL:String = "horizontal";
+        
+        /**
+         *  The user scrolled vertically.
+         * 
+         * @playerversion Flash 10.0
+         * @playerversion AIR 2.0
+         * @langversion 3.0
+         */
+        public static const VERTICAL:String = "vertical";
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/SelectionEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/SelectionEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/SelectionEvent.as
new file mode 100644
index 0000000..48c74f0
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/SelectionEvent.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.textLayout.edit.SelectionState;
+	
+	/** 
+	 * A TextFlow instance dispatches a SelectionEvent object when
+	 * an EditManager or SelectionManager changes or selects a range of text. 
+	 * For example, this event is dispatched not only when a range of text is
+	 * selected, but also when the selection changes because the
+	 * user clicks elsewhere in the text flow. Moreover, this
+	 * event is also dispatched when an EditManager changes
+	 * the text or text formatting within a range of text.
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 */
+	public class SelectionEvent extends Event
+	{
+		/** 
+		 * The SelectionEvent.SELECTION_CHANGE constant defines the value of the 
+		 * type property of the event object for a selection event. 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public static const SELECTION_CHANGE:String = "selectionChange";
+		public static const SELECT_ALL:String = "selectAll";
+		
+		private var _selectionState:SelectionState;
+		
+		/** 
+		 * Creates an event object that contains information about a flow operation.
+		 * @param type		The type of the event. Event listeners can access this information through the
+		 * inherited <code>type</code> property. There is only one type of SelectionEvent: 
+		 * <code>SelectionEvent.SELECTION_CHANGE</code>; 
+		 * @param bubbles 	Indicates whether an event is a bubbling event.This event does not bubble.
+		 * @param cancelable 	Indicates whether the behavior associated with the event can be prevented.
+		 * @param range		An object of type ElementRange that describes the range of text selected.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function SelectionEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, selectionState:SelectionState=null)
+		{
+			_selectionState = selectionState;
+			super(type, bubbles, cancelable);
+		}
+
+		/** 
+		 * An object of type SelectionState that represents the selected range associated with this SelectionEvent.
+		 * 
+		 * <p>You can use this property, along with the ElementRange class, to create an ElementRange
+		 * instance that represents the range of selected text.
+		 * You can use the following line of code to create an instance of the
+		 * ElementRange class that represents the range of selected text
+		 * (the <code>ev</code> variable represents the event object, and the conditional operator 
+		 * is used to guard against a <code>null</code> value for the <code>selectionState</code>
+		 * property):</p>
+		 * <listing>
+		 * // Find selected element range
+		 * var range:ElementRange = ev.selectionState ?  
+		 * 	ElementRange.createElementRange(ev.selectionState.textFlow,
+		 * 	ev.selectionState.absoluteStart, ev.selectionState.absoluteEnd) : null;</listing>
+		 * 
+		 * 
+		 * 
+		 * @see org.apache.flex.textLayout.edit.ElementRange
+		 * @see org.apache.flex.textLayout.edit.SelectionState
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */		
+		public function get selectionState():SelectionState
+		{ return _selectionState; }	
+		public function set selectionState(value:SelectionState):void
+		{ _selectionState = value; }	
+		
+		
+		/** @private */
+		override public function cloneEvent():IFlexJSEvent
+		{
+			return new SelectionEvent(type, bubbles, cancelable, _selectionState);
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/StatusChangeEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/StatusChangeEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/StatusChangeEvent.as
new file mode 100644
index 0000000..5decce8
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/StatusChangeEvent.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.textLayout.elements.IFlowElement;
+//	import org.apache.flex.events.ErrorEvent;
+	
+	/** 
+	 * A TextFlow instance dispatches this event when the status of a FlowElement changes. 
+	 * This event can be used to detect when an inline graphic element has
+	 * completed loading. You can use your event handler to recompose the text flow
+	 * based on the presence of the newly loaded inline graphic element.
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 */
+	public class StatusChangeEvent extends Event
+	{
+	    /** 
+	     * Defines the value of the <code>type</code> property of a <code>inlineGraphicStatusChanged</code> event object.
+	     * @playerversion Flash 10
+	     * @playerversion AIR 1.5
+	     * @langversion 3.0 
+	     */
+	    public static const INLINE_GRAPHIC_STATUS_CHANGE:String = "inlineGraphicStatusChange";
+	    
+	    private var _element:IFlowElement;
+	    private var _status:String;
+//	    private var _errorEvent:ErrorEvent;
+
+		/** Creates an event object that contains information about a status change.
+		 * @param type		The type of the event. Event listeners can access this information through the
+		 * inherited <code>type</code> property. There is only one type of StatusChangeEvent: 
+		 * <code>StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE</code>; 
+		 * @param bubbles 	Indicates whether an event is a bubbling event.This event does not bubble.
+		 * @param cancelable 	Indicates whether the behavior associated with the event can be prevented.
+		 * This event cannot be cancelled.
+		 * @param element The FlowElement instance that has experienced a change in status.
+		 * @param newStatus The FlowElement instance's new status.
+		 * @param e The ErrorEvent object, if any, associated with the status.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 **/
+		public function StatusChangeEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, element:IFlowElement = null,status:String = null)//,errorEvent:ErrorEvent = null
+		{
+			_element = element;
+			_status = status;
+//			_errorEvent = errorEvent;
+			super(type, bubbles, cancelable);
+		}
+		
+      	/** @private */
+		override public function cloneEvent():IFlexJSEvent
+		{
+			return new StatusChangeEvent(type,bubbles,cancelable,_element,_status);//,_errorEvent
+		}
+		
+		/** 
+		 * The FlowElement instance that has experienced a change in status. 
+		 * @see org.apache.flex.textLayout.elements.FlowElement
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function get element():IFlowElement
+		{ return _element; }		
+		public function set element(value:IFlowElement):void
+		{ _element = value; }		
+		
+		/**
+		 * The FlowElement's new status. The possible values of this property are
+		 * defined by the InlineGraphicElementStatus class. There are five static constants
+		 * available in the InlineGraphicElementStatus class:
+		 * <ul>
+		 *   <li>ERROR : String = "error". An error occurred during loading of a referenced graphic.</li>
+		 *   <li>LOADING : String = "loading". Load has been initiated (but not completed) on a graphic element that is a URL.</li>
+		 *   <li>LOAD_PENDING : String = "loadPending". Graphic element is an URL that has not been loaded.</li>
+		 *   <li>READY : String = "ready". Graphic is completely loaded and properly sized.</li>
+		 *   <li>SIZE_PENDING : String = "sizePending". Graphic element with auto or percentage width/height has completed loading but has not been recomposed.</li>
+		 * </ul>
+		 *
+		 * @see org.apache.flex.textLayout.elements.InlineGraphicElementStatus
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+		public function get status():String
+		{ return _status; }
+		public function set status(value:String):void
+		{ _status = value; }
+		
+		/** 
+		 * The ErrorEvent object that was dispatched as a result of the status change. 
+		 * @see org.apache.flex.events.ErrorEvent
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 */
+//		public function get errorEvent():ErrorEvent
+//		{ return _errorEvent; }
+//		public function set errorEvent(value:ErrorEvent):void
+//		{ _errorEvent = value; }
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/TextLayoutEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/TextLayoutEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/TextLayoutEvent.as
new file mode 100644
index 0000000..cfd5c09
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/TextLayoutEvent.as
@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.Event;
+	
+	/**
+	 * A TextLayoutEvent instance represents an event, such as the 
+	 * <code>TextLayoutEvent.SCROLL</code> event, that does not require
+	 * custom properties. 
+	 * <p>A scroll event is represented by a TextLayoutEvent instance with its 
+	 * <code>type</code> property set to <code>TextLayoutEvent.SCROLL</code>.
+	 * A class specifically for scroll events is not necessary because there are
+	 * no custom properties for a scroll event, as there are for the other
+	 * events that have specific event classes.
+	 * If a new text layout event is needed, and the event does not require
+	 * custom properties, the new event will also be represented by a
+	 * TextLayoutEvent object, but with its <code>type</code> property
+	 * set to a new static constant.
+	 * </p>
+	 *
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0
+	 */
+	public class TextLayoutEvent extends Event
+	{
+	    /**
+	     *  The <code>TextLayoutEvent.SCROLL</code> constant defines the value of the
+	     *  <code>type</code> property of the event object for a <code>scroll</code> event.
+	     * @playerversion Flash 10
+	     * @playerversion AIR 1.5
+	     * @langversion 3.0
+	     */
+	    public static const SCROLL:String = "scroll";
+	    
+		/**
+		 *  The TextLayoutEvent class represents the event object passed to
+		 *  the event listener for many Text Layout events.
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public function TextLayoutEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+        /** @private */
+        override public function cloneEvent():IFlexJSEvent
+        {
+        	return new TextLayoutEvent(type, bubbles, cancelable);
+        }		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/UpdateCompleteEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/UpdateCompleteEvent.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/UpdateCompleteEvent.as
new file mode 100644
index 0000000..3607206
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/events/UpdateCompleteEvent.as
@@ -0,0 +1,106 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.events
+{
+	import org.apache.flex.events.IFlexJSEvent;
+	import org.apache.flex.events.Event;
+	
+	import org.apache.flex.textLayout.container.IContainerController;
+	import org.apache.flex.textLayout.elements.ITextFlow;
+
+	/** 
+	 * A TextFlow instance dispatches this event after any of its containers completes 
+	 * an update. Each text container has two states: composition and display. This 
+	 * event notifies you when the display phase has ended. This provides an 
+	 * opportunity to make any necessary changes to the container when it is ready to
+	 * be displayed, but hasn't yet been painted to the screen.
+	 * 
+	 * @internal Note: the DamageEvent_example class contains a good example of 
+	 * using the UpdateCompleteEvent, so I have included it as the class example
+	 * instead of creating a new example. I've updated the description of the
+	 * DamageEvent_example file to include prominent mention of the UpdateCompleteEvent.
+	 *
+	 * @see org.apache.flex.textLayout.elements.TextFlow 
+	 * @playerversion Flash 10
+	 * @playerversion AIR 1.5
+	 * @langversion 3.0 
+	 */
+	public class UpdateCompleteEvent extends Event
+	{
+	    /** 
+	     * Defines the value of the <code>type</code> property of an <code>UpdateCompleteEvent</code> object 
+	     * @playerversion Flash 10
+	     * @playerversion AIR 1.5
+	     * @langversion 3.0 
+	     */
+	    public static const UPDATE_COMPLETE:String = "updateComplete";
+	    
+	    /** @private */
+	    private var _controller:IContainerController;
+	    /** @private */
+		private var _textFlow:ITextFlow;
+		
+		/** Constructor
+		 * @param type event type - use the static property UPDATE_COMPLETE.
+		 * @param bubbles Indicates whether an event is a bubbling event. This event does not bubble.
+		 * @param cancelable Indicates whether the behavior associated with the event can be prevented.
+		 * This event cannot be cancelled.
+		 * @param controller The ContainerController whose container was updated
+		 * @param textFlow The TextFlow which was updated
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 
+		 **/
+		public function UpdateCompleteEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false, textFlow:ITextFlow =  null, controller:IContainerController=null)
+		{
+			super(type, bubbles, cancelable);
+			this.controller = controller;
+			_textFlow = textFlow;
+		}
+
+      	/** @private */
+		override public function cloneEvent():IFlexJSEvent
+		{
+			return new UpdateCompleteEvent(type, bubbles, cancelable, _textFlow, _controller);
+		}
+
+		/** 
+		 * The controller of the container being updated
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0 		 
+		 */
+		public function get controller():IContainerController
+		{ return _controller; }
+		public function set controller(c:IContainerController):void
+		{ _controller = c; }
+		
+		
+		/**
+		 * TextFlow which has been updated. 
+		 * @playerversion Flash 10
+		 * @playerversion AIR 1.5
+		 * @langversion 3.0
+		 */
+		public  function get textFlow():ITextFlow
+		{ return _textFlow; }
+		public  function set textFlow(value:ITextFlow):void
+		{ _textFlow = value; }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/INumberLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/INumberLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/INumberLineFactory.as
new file mode 100644
index 0000000..3d619a1
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/INumberLineFactory.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	import org.apache.flex.geom.Rectangle;
+	import org.apache.flex.textLayout.compose.ISWFContext;
+	import org.apache.flex.textLayout.elements.IBackgroundManager;
+	import org.apache.flex.textLayout.formats.ITextLayoutFormat;
+	public interface INumberLineFactory extends IStringTextLineFactory
+	{
+		function set compositionBounds(compositionBounds:Rectangle):void;
+		function set swfContext(swfContext:ISWFContext):void;
+		function set listStylePosition(listStylePosition:String):void;
+		function get listStylePosition():String;
+		function set paragraphFormat(paragraphFormat:ITextLayoutFormat):void;
+		function set textFlowFormat(textFlowFormat:ITextLayoutFormat):void;
+		function set markerFormat(val:ITextLayoutFormat):void;
+		function set text(text:String):void;
+		function createTextLines(arg:Function):void;
+		function clearBackgroundManager():void;
+		function get backgroundManager():IBackgroundManager;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/IStringTextLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/IStringTextLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/IStringTextLineFactory.as
new file mode 100644
index 0000000..5f6c41d
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/IStringTextLineFactory.as
@@ -0,0 +1,24 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	public interface IStringTextLineFactory extends ITextLineFactory
+	{
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITLFFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITLFFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITLFFactory.as
new file mode 100644
index 0000000..4b204b5
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITLFFactory.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory {
+	import org.apache.flex.core.IParentIUIBase;
+	import org.apache.flex.graphics.ICompoundGraphic;
+	import org.apache.flex.graphics.IRect;
+	import org.apache.flex.text.engine.ITextFactory;
+	public interface ITLFFactory {
+		function get textFactory():ITextFactory;
+		function getRect():IRect;
+		function getCompoundGraphic():ICompoundGraphic;
+		function getContainer():IParentIUIBase;		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fd08d137/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITextLineFactory.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITextLineFactory.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITextLineFactory.as
new file mode 100644
index 0000000..854db9c
--- /dev/null
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/factory/ITextLineFactory.as
@@ -0,0 +1,24 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.textLayout.factory
+{
+	public interface ITextLineFactory
+	{
+	}
+}
\ No newline at end of file


Mime
View raw message