Transferred from the Adobe Open Source Subversion Repository

Revision: 10482
Author:   klin@adobe.com
Date:     2009-09-22T01:15:07.187325Z

Log Message:
-----------
https://bugs.adobe.com/jira/browse/SDK-21534 - Added support for the new change and changing events pattern. "changing" events are now dispatched at the start of a user interaction and "change" events are dispatched at the end of the user interaction. For example, pressing and holding on the incrementButton of a ScrollBar will cause a "changing" event when first pressed and a "change" event when the user lets go of the incrementButton. For more information, see the wiki page (http://opensource.adobe.com/wiki/display/flexsdk/change+and+changing+events).

We also ensure that if an animation is interrupted by another user interaction, the value is set to a valid value near where the animation was stopped and immediately begin a new animation. This prevents jumpy behavior by both Slider and ScrollBar.

Lastly, checkintests are updated to reflect the new behavior.

QE Notes: ScrollBar, Slider tests involving change events.
Doc Notes: None
Bugs: SDK-21534
Reviewer: Ryan
API Change: No
Is noteworthy for integration: No
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/ScrollBarTestScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ScrollBarBase.as
@@ -292,6 +292,7 @@
      */
     private var steppingDown:Boolean;
     private var steppingUp:Boolean;
+	private var isStepping:Boolean;

     /**
      * @private
@@ -660,15 +661,10 @@
             val = Math.min(value + pageSize, maximum);
         else
             val = Math.max(value - pageSize, minimum);
-        if (getStyle("smoothScrolling")) {
-            startAnimation(getStyle("repeatInterval"), val, linearEaser);
-            animatingSinglePage = true;
-        }
+        if (getStyle("smoothScrolling"))
+            startAnimation(getStyle("repeatInterval"), val, linearEaser);
         else
-        {
             setValue(val);
-            dispatchEvent(new Event("change"));
-        }
     }

     //--------------------------------------------------------------------------
@@ -743,7 +739,26 @@
     mx_internal function viewportVerticalScrollPositionChangeHandler(event:PropertyChangeEvent):void
     {
     }
-
+
+	//---------------------------------
+	// Thumb dragging handlers
+	//---------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function thumb_mouseDownHandler(event:MouseEvent) : void
+	{
+		// Stop animation before thumb dragging
+		if (animatingSinglePage)
+		{
+			animationEndHandler(animator);
+			animator.stop();
+		}
+
+		super.thumb_mouseDownHandler(event);
+	}
+
     //---------------------------------
     // Mouse up/down handlers
     //---------------------------------
@@ -764,27 +779,43 @@
      */
     protected function button_buttonDownHandler(event:Event):void
     {
+		// Make sure we finish any running page animation before starting
+		// to step.
+		if (animatingSinglePage)
+		{
+			animationEndHandler(animator);
+			animator.stop();
+		}
+
         // Noop if we're currently running a stepping animation. We get
         // called repeatedly here due to the button's autoRepeat
         if (!steppingDown && !steppingUp)
         {
             var increment:Boolean = (event.target == incrementButton);
-            var oldValue:Number = value;
-
+
+			if (!isStepping &&
+				((increment && value < maximum) ||
+				 (!increment && value > minimum)))
+			{
+				dispatchEvent(new FlexEvent(FlexEvent.CHANGING));
+				isStepping = true;
+			}
+
             // FIXME (chaase): first step is non-animated, just to simplify the delayed
             // start of the animated stepping. Seems okay, but worth thinking
             // about whether we should animate the first step too
             changeValueByStep(increment);
-
+
+			systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
+				button_buttonUpHandler, true);
+			systemManager.getSandboxRoot().addEventListener(
+				SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
+
             // Only animate if smoothScrolling enabled and we're not at the end already
             if (getStyle("smoothScrolling") &&
                 ((increment && value < maximum) ||
                  (!increment && value > minimum)))
             {
-                systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP,
-                    button_buttonUpHandler, true);
-                systemManager.getSandboxRoot().addEventListener(
-                    SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
                 // FIXME (chaase): what's a reasonable stepSize? Can't use viewport's because
                 // it can vary widely depending on what items are in the view. Can't use
                 // default stepSize because it can be quite small if not changed by
@@ -817,19 +848,26 @@
             {
                 animationEndHandler(animator);
             }
-            else
-            {
-                // probably shouldn't get here, but just in case
-                steppingUp = steppingDown = false;
-            }
             // stop even if !isPlaying - it might just be startDelayed
             animator.stop();
-
-            systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
-                button_buttonUpHandler, true);
-            systemManager.getSandboxRoot().removeEventListener(
-                SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
-        }
+
+			// Dispatch change event after animation is finished or stopped
+			dispatchEvent(new Event(Event.CHANGE));
+
+			steppingUp = steppingDown = false;
+			isStepping = false;
+        }
+		else if (isStepping)
+		{
+			// Dispatch change event for no animation case
+			dispatchEvent(new Event(Event.CHANGE));
+			isStepping = false;
+		}
+
+		systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP,
+			button_buttonUpHandler, true);
+		systemManager.getSandboxRoot().removeEventListener(
+			SandboxMouseEvent.MOUSE_UP_SOMEWHERE, button_buttonUpHandler);
     }

     //---------------------------------
@@ -852,14 +890,17 @@
             return;

         // Make sure we finish any running page animation before starting
-        // a new one. end() will set value to the desired paged-to value for
-        // that running animation
+        // a new one.
         if (animatingSinglePage)
-            animator.end();
-
+		{
+			animationEndHandler(animator);
+            animator.stop();
+		}
         // Cache original event location for use on later repeating events
         trackPosition = track.globalToLocal(new Point(event.stageX, event.stageY));
-
+
+		dispatchEvent(new FlexEvent(FlexEvent.CHANGING));
+
         // If the user shift-clicks on the track, then offset the event coordinates so
         // that the thumb ends up centered under the mouse.
         if (event.shiftKey)
@@ -887,11 +928,12 @@
                 startAnimation(slideDuration *
                     (Math.abs(value - newScrollValue) / (maximum - minimum)),
                     adjustedValue, deceleratingSineEaser);
+				animatingSinglePage = true;
             }
             else
             {
                 setValue(adjustedValue);
-                dispatchEvent(new Event("change"));
+                dispatchEvent(new Event(Event.CHANGE));
             }
             return;
         }
@@ -1023,11 +1065,14 @@
             // appropriate direction, ensuring that we stop on a content
             // item boundary
             changeValueByStep(steppingDown);
-            steppingUp = steppingDown = false;
             animator.startDelay = 0;
-        }
+			return;
+        }
+
+		if (animatingSinglePage)
+			dispatchEvent(new Event(Event.CHANGE));
+
         animatingSinglePage = false;
-        dispatchEvent(new Event("change"));
     }

     /**
@@ -1146,19 +1191,49 @@
         systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE,
             track_mouseUpHandler);

-        if (trackScrollTimer)
-            trackScrollTimer.reset();
-
-        if (getStyle("smoothScrolling") && !animatingSinglePage)
-        {
-            if (animator.isPlaying)
-            {
-                animationEndHandler(animator);
-            }
-            // Stop it regardless, in case the animation is startDelayed and
-            // thus not 'playing', but still active
-            animator.stop();
-        }
+		// First, we check for smoothScrolling and also if we are
+		// not in a shift-click case.
+        if (getStyle("smoothScrolling"))
+        {
+			if (!animatingSinglePage)
+			{
+				// We check the timer to see if the user released the mouse
+				// before or after the repeat delay has expired. If not,
+				// we are currently repeating and we should end the animation
+				// as well as dispatch a change event.
+				if (trackScrollTimer && trackScrollTimer.running)
+				{
+					// If the animation has not yet finished before the repeat delay
+					// we set animatingSinglePage to true. Otherwise, the animation
+					// is done but repeating has not begun so we dispatch a change
+					// event.
+					if (animator.isPlaying)
+						animatingSinglePage = true;
+					else
+						dispatchEvent(new Event(Event.CHANGE));
+				}
+				else
+				{
+					if (animator.isPlaying)
+					{
+						animationEndHandler(animator);
+					}
+					// Stop it regardless, in case the animation is startDelayed and
+					// thus not 'playing', but still active
+					animator.stop();
+
+					dispatchEvent(new Event(Event.CHANGE));
+				}
+			}
+        }
+		else
+		{
+			// Dispatch change if there's no animation.
+			dispatchEvent(new Event(Event.CHANGE));
+		}
+
+		if (trackScrollTimer)
+			trackScrollTimer.reset();
     }

     /**


Added getArg(), mainly so that it can be used when dispatching
and overridden in subclasses.

git-svn-id: b675b909355d5cf946977f44a8ec5a6ceb3782e4@802 ed5b42cb-e716-0410-a449-f6a68f950b19

--- src/as/com/threerings/flex/CommandButton.as
+++ src/as/com/threerings/flex/CommandButton.as
@@ -70,6 +70,14 @@
     }

     /**
+     * Get the argument (or arguments, in an Array).
+     */
+    public function getArg () :Object
+    {
+        return _arg;
+    }
+
+    /**
      * Emulate a user click, dispatching all relevant events.
      */
     public function activate () :void
@@ -86,7 +94,7 @@
     override protected function clickHandler (event :MouseEvent) :void
     {
         super.clickHandler(event);
-        processCommandClick(this, event, _cmdOrFn, _arg);
+        processCommandClick(this, event, _cmdOrFn, getArg());
     }

     internal static function validateCmd (cmdOrFn :Object) :void


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

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

--- frameworks/projects/spark/src/spark/components/FormItem.as
+++ frameworks/projects/spark/src/spark/components/FormItem.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 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 spark.components
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 8486
Author:   smgilson@adobe.com
Date:     2009-07-09T18:42:45.734868Z

Log Message:
-----------
Third checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -206,7 +206,7 @@
  *
  *  @mxml
  *
- *
The <Scroller> tag inherits all of the tag
+ *
The <s:Scroller> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:

  *
  *


Transferred from the Adobe Open Source Subversion Repository

Revision: 18629
Author:   eday@adobe.com
Date:     2010-11-16T21:40:30.154615Z

Log Message:
-----------
Kinetic scroller changes:
- Distance of drag/scroll now affects duration (not velocity) of throw.
- Final scroll positions are rounded to avoid extra property changes.
- Slightly increased minimum velocity needed to start throw.
- Use stageWidth/stageHeight to determine relative distance of scroll (instead of stage.width/height)
- Normalize velocity constants to inches-per-second so they'll scale correctly across DPIs.
- Limit throw velocity to fixed maximum.

QE notes:
Doc notes:
Bugs: SDK-27989, SDK-27581, SDK-27578, SDK-28011
Reviewer: Ryan
Tests run: checkintests, plus Steve S. ran mobile and desktop list tests.
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as

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

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -19,6 +19,7 @@
 import flash.events.MouseEvent;
 import flash.geom.Point;
 import flash.system.ApplicationDomain;
+import flash.system.Capabilities;
 import flash.text.TextField;
 import flash.ui.Keyboard;

@@ -431,9 +432,15 @@

     /**
      *  @private
-     *  Length the touch scroll throw effect should run
-     */
-    private static const THROW_EFFECT_TIME:int = 2000;
+     *  Minimum duration of throw effects
+     */
+    private static const THROW_EFFECT_DURATION_MINIMUM:int = 500;
+
+    /**
+     *  @private
+     *  Range (maximum - minimum) of the throw effect duration
+     */
+    private static const THROW_EFFECT_DURATION_RANGE:int = 2500;

     //--------------------------------------------------------------------------
     //
@@ -1063,12 +1070,42 @@
         removeEventListener(MouseEvent.MOUSE_DOWN, touchScrolling_captureMouseHandler, true);
     }

+
+    /**
+     *  @private
+     *  Use the specified scroll distance ratio to determine the duration of the throw effect
+     */
+    private function calculateThrowEffectTime(distanceRatio:Point):int
+    {
+        if (scrollerLayout)
+        {
+            // the throw will last 0.5sec - 3sec, depending on the distance
+            // of the scroll.
+            var throwTimeX:int = THROW_EFFECT_DURATION_MINIMUM + (THROW_EFFECT_DURATION_RANGE * distanceRatio.x);
+            var throwTimeY:int = THROW_EFFECT_DURATION_MINIMUM + (THROW_EFFECT_DURATION_RANGE * distanceRatio.y);
+
+            if (scrollerLayout.canScrollHorizontally && scrollerLayout.canScrollVertically)
+            {
+                return Math.max(throwTimeX,throwTimeY);
+            }
+            else if (scrollerLayout.canScrollHorizontally)
+            {
+                return throwTimeX;
+            }
+            else if (scrollerLayout.canScrollVertically)
+            {
+                return throwTimeY;
+            }
+        }
+        return 0;
+    }
+
     /**
      *  @private
      *  Set up the effect to be used for the throw animation
      *  FIXME (rfrishbe): this could use some work
      */
-    private function setUpThrowEffect(velocityX:Number, velocityY:Number):void
+    private function setUpThrowEffect(velocityX:Number, velocityY:Number, distanceRatio:Point):void
     {
         // create throwEffect if we haven't already
         if (!throwEffect)
@@ -1076,7 +1113,6 @@
             throwEffect = new Animate();
             throwEffect.addEventListener(EffectEvent.EFFECT_END, throwEffect_effectEndHandler);
             throwEffect.target = viewport;
-            throwEffect.duration = THROW_EFFECT_TIME;

             // effect and easer stuff should be combined some or maybe we just need one
             // touch specific class rather than two
@@ -1084,14 +1120,13 @@
             throwEffect.easer = throwEaser;
         }

+        // Calculate the effect duration
+        var throwEffectTime:int = calculateThrowEffectTime(distanceRatio);
+        throwEffect.duration = throwEffectTime;
+
         // calculate the finalVSP/finalHSP
         var finalHSP:Number = viewport.horizontalScrollPosition;
         var finalVSP:Number = viewport.verticalScrollPosition;
-
-        // want velocity to be 0 and to decrease by currentFriction every
-        // SCROLLING_TIMER_DELAY over EFFECT_TIME total
-        var decelerationRateX:Number = velocityX/THROW_EFFECT_TIME;
-        var decelerationRateY:Number = velocityY/THROW_EFFECT_TIME;

         // figure out where we're scrolling to
         if (scrollerLayout && scrollerLayout.canScrollHorizontally)
@@ -1101,9 +1136,12 @@
             var cWidth:Number = viewport.contentWidth;
             var maxWidth:Number = Math.max(0, (cWidth == 0) ? viewport.horizontalScrollPosition : cWidth - viewportWidth);

-            // FORMULA: initialVelocity.y * ellapsedTime - (0.5 * frictionToUse * ellapsedTime * ellapsedTime);
-            finalHSP = viewport.horizontalScrollPosition - (velocityX * THROW_EFFECT_TIME) + (.5 * decelerationRateX * THROW_EFFECT_TIME * THROW_EFFECT_TIME);
-
+            // we want the throw to go half the distance it would if its velocity remained constant
+            finalHSP = viewport.horizontalScrollPosition - (velocityX * throwEffectTime * 0.5);
+
+            // Make sure the animation ends on a nice round number so extra scroll position
+            // property changes don't occur after the touchInteractionEnd event is dispatched.
+            finalHSP = Math.round(finalHSP);
         }

         if (scrollerLayout && scrollerLayout.canScrollVertically)
@@ -1113,8 +1151,12 @@
             var cHeight:Number = viewport.contentHeight;
             var maxHeight:Number = Math.max(0, (cHeight == 0) ? viewport.verticalScrollPosition : cHeight - viewportHeight);

-            // FORMULA: initialVelocity.y * ellapsedTime - (0.5 * frictionToUse * ellapsedTime * ellapsedTime);
-            finalVSP = viewport.verticalScrollPosition - (velocityY * THROW_EFFECT_TIME) + (.5 * decelerationRateY * THROW_EFFECT_TIME * THROW_EFFECT_TIME);
+            // we want the throw to go half the distance it would if its velocity remained constant
+            finalVSP = viewport.verticalScrollPosition - (velocityY * throwEffectTime * 0.5);
+
+            // Make sure the animation ends on a nice round number so extra scroll position
+            // property changes don't occur after the touchInteractionEnd event is dispatched.
+            finalVSP = Math.round(finalVSP);
         }

         // maybe use motion paths with more keyframes for the bounce effect??
@@ -1133,9 +1175,9 @@

             // see formula in VSP section.
             if (finalHSP == hspToUse)
-                timeToReachHSP = THROW_EFFECT_TIME;
+                timeToReachHSP = throwEffectTime;
             else
-                timeToReachHSP = THROW_EFFECT_TIME*(1-(Math.pow(1-((hspToUse-hsp)/(finalHSP-hsp)),.25)));
+                timeToReachHSP = throwEffectTime*(1-(Math.pow(1-((hspToUse-hsp)/(finalHSP-hsp)),.25)));

             horizontalMP.keyframes = Vector.<Keyframe>([new Keyframe(0, null), new Keyframe(timeToReachHSP, hspToUse)]);
             throwEffectMotionPaths.push(horizontalMP);
@@ -1152,13 +1194,13 @@
             var vspToUse:Number = Math.min(Math.max(finalVSP,0), maxHeight);

             // since easing function is f(t) = start + (final - start) * e(t)
-            // e(t) = Math.pow(1 - t/THROW_EFFECT_TIME, 4)
+            // e(t) = Math.pow(1 - t/throwEffectTime, 4)
             // We want to solve for t when e(t) = vspToUse
-            // t = THROW_EFFECT_TIME*(1-(Math.pow(1-((vspToUse-vsp)/(finalVSP-vsp)),.25)));
+            // t = throwEffectTime*(1-(Math.pow(1-((vspToUse-vsp)/(finalVSP-vsp)),.25)));
             if (finalVSP == vspToUse)
-                timeToReachVSP = THROW_EFFECT_TIME;
+                timeToReachVSP = throwEffectTime;
             else
-                timeToReachVSP = THROW_EFFECT_TIME*(1-(Math.pow(1-((vspToUse-vsp)/(finalVSP-vsp)),.25)));
+                timeToReachVSP = throwEffectTime*(1-(Math.pow(1-((vspToUse-vsp)/(finalVSP-vsp)),.25)));

             verticalMP.keyframes = Vector.<Keyframe>([new Keyframe(0, null), new Keyframe(timeToReachVSP, vspToUse)]);
             throwEffectMotionPaths.push(verticalMP);
@@ -1632,11 +1674,10 @@
     /**
      *  @private
      */
-    mx_internal function performThrow(velocityX:Number, velocityY:Number):void
+    mx_internal function performThrow(velocityX:Number, velocityY:Number, distanceRatio:Point):void
     {
         stoppedPreemptively = false;
-        setUpThrowEffect(velocityX, velocityY);
-
+        setUpThrowEffect(velocityX, velocityY, distanceRatio);
         throwEffect.play();
     }

@@ -1724,10 +1765,17 @@

     /**
      *  @private
-     *  Minimum velocity needed to start a throw gesture
-     */
-    private static const MIN_START_VELOCITY:Number = 0.05;
-
+     *  Minimum velocity needed to start a throw gesture, in inches per second.
+     */
+    private static const MIN_START_VELOCITY_IPS:Number = 0.8;
+
+    /**
+     *  @private
+     *  Maximum velocity of throw effect, in inches per second.
+     */
+    private static const MAX_THROW_VELOCITY_IPS:Number = 10.0;
+
+
     /**
      *  @private
      *  Weights to use when calculating velocity, giving the last velocity more of a weight
@@ -2164,9 +2212,8 @@

         // for the max size, we couldn't decide between using screen width/height or
         // scroller width/height, so we're using a weighted average for it
-        // FIXME (rfrishbe): use stage.stageWidth
-        var widthToUseForRatio:Number = (2*scroller.width + scroller.stage.width)/3;
-        var heightToUseForRatio:Number = (2*scroller.height + scroller.stage.height)/3;
+        var widthToUseForRatio:Number = (2*scroller.width + scroller.stage.stageWidth)/3;
+        var heightToUseForRatio:Number = (2*scroller.height + scroller.stage.stageHeight)/3;
         var lastMouseEventPoint:Point = mouseEventCoordinatesHistory[endIndex];
         var movedRatio:Point = new Point(Math.abs(RATIO_TO_USE*lastMouseEventPoint.x/widthToUseForRatio), Math.abs(RATIO_TO_USE*lastMouseEventPoint.y/heightToUseForRatio));

@@ -2176,8 +2223,9 @@
         var lastVelocity:Point = lastMouseEventPoint.subtract(mouseEventCoordinatesHistory[indexBeforeLast]);
         lastVelocity.x /= lastDt;
         lastVelocity.y /= lastDt;
-        lastVelocity.x *= movedRatio.x;
-        lastVelocity.y *= movedRatio.y;
+
+
+        var minVelocityPixels:Number = MIN_START_VELOCITY_IPS * flash.system.Capabilities.screenDPI / 1000;

         var scrollEndEvent:TouchInteractionEvent;

@@ -2185,7 +2233,7 @@
         // FIXME (rfrishbe): this should be parameterized better and the heuristic should
         // be documented better
         if ( (lastDt >= 3*averageDt) &&
-            (lastVelocity.length <= MIN_START_VELOCITY))
+            (lastVelocity.length <= minVelocityPixels))
         {
             isScrolling = false;

@@ -2200,14 +2248,10 @@
         // calculate the velocity using a weighted average
         var throwVelocity:Point = calculateThrowVelocity();

-        // use ratio of how far they scrolled to scale the velocity
-        throwVelocity.x *= movedRatio.x;
-        throwVelocity.y *= movedRatio.y;
-
         // if the velocity is greater than the minimum velocity, start throwing
-        if (throwVelocity.length > MIN_START_VELOCITY)
-        {
-            scroller.performThrow(throwVelocity.x, throwVelocity.y);
+        if (throwVelocity.length > minVelocityPixels)
+        {
+            scroller.performThrow(throwVelocity.x, throwVelocity.y, movedRatio);
         }
         else
         {
@@ -2267,7 +2311,12 @@
             i++;
         }

-        return new Point(weightedSumX/totalWeight, weightedSumY/totalWeight);
+        // Limit the velocity to an absolute maximum
+        var maxPixelsPerMS:Number = MAX_THROW_VELOCITY_IPS * flash.system.Capabilities.screenDPI / 1000;
+        var velX:Number = Math.min(maxPixelsPerMS,Math.max(-maxPixelsPerMS,weightedSumX/totalWeight));
+        var velY:Number = Math.min(maxPixelsPerMS,Math.max(-maxPixelsPerMS,weightedSumY/totalWeight));
+
+        return new Point(velX,velY);
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 9181
Author:   cframpto@adobe.com
Date:     2009-08-07T22:15:38.583672Z

Log Message:
-----------
Per Hans, if TextArea and lineBreak=”toFit”, set the scroller’s horinzontalScrollPolicy to “off”.  Added a “styleChanged” event to RET so that TextArea.  If lineBreak="toFit" the scroller's horizontalScrollPolicy style is set to off.  If lineBreak="explicit" the scroller's horizontalScrollPolicy style is set auto if it off.  RET's horizontalScrollPolicy is auto in both of these cases.

Modified getEditManager() and endEditManager() so that all the edits for each API call are grouped together as a composite operation on the undo queue.  Ctrl-z should undo the entire API call.

QE notes:
Doc notes:
Bugs: SDK-22469 and SDK-22529
Reviewer: Gordon
Tests run:
Is noteworthy for integration: possibly - the RET api calls insertText(), appendText() and setFormatOfRange() add a single composite operation do TLF's undo queue

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -434,13 +434,14 @@
         if (instance == textDisplay)
         {
             // In default.css, the TextArea selector has a declaration
-            // for lineBreak which sets it to "toFit".  It needs to be on
-            // TextArea rather than RichEditableText so that if changed later it
-            // will be inherited.
+            // for lineBreak which sets it to "toFit".

             // The skin is loaded after the intial properties have been
             // set so these wipe out explicit sets.
             textDisplay.multiline = true;
+
+            textDisplay.addEventListener("styleChanged",
+                                         textDisplay_styleChangedHandler);
         }

         // The scroller, between textDisplay and this in the chain, should not
@@ -456,9 +457,23 @@
                 scroller.horizontalScrollBar.snapInterval = 0;
             if (scroller.verticalScrollBar)
                 scroller.verticalScrollBar.snapInterval = 0;
-        }
-    }
-
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function partRemoved(partName:String,
+                                            instance:Object):void
+    {
+        super.partRemoved(partName, instance);
+
+        if (instance == textDisplay)
+        {
+            textDisplay.removeEventListener("styleChanged",
+                                            textDisplay_styleChangedHandler);
+        }
+    }
     //--------------------------------------------------------------------------
     //
     //  Methods
@@ -518,6 +533,39 @@

         textDisplay.scrollToRange(anchorPosition, activePosition);
     }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Called when the RichEditableText dispatches a 'styleChanged' event.
+     */
+    private function textDisplay_styleChangedHandler(event:Event):void
+    {
+        if (!scroller)
+            return;
+
+        // If there is a scroller and line breaks are "toFit" turn off the
+        // horizontal scroll bar so the scroller will give us a consistent
+        // width and the text will wrap in the same place.
+        if (textDisplay.getStyle("lineBreak") == "toFit")
+        {
+            if (scroller.getStyle("horizontalScrollPolicy") != "off")
+                scroller.setStyle("horizontalScrollPolicy", "off");
+        }
+        else
+        {
+            // This could potentially wipe out a user specified setting.
+            // Workaround it by settting Scroller's horizontalScrollPolicy
+            // after every RET style change.
+            if (scroller.getStyle("horizontalScrollPolicy") == "off")
+                scroller.setStyle("horizontalScrollPolicy", "auto");
+        }
+    }
 }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 12850
Author:   jimurphy@adobe.com
Date:     2009-12-11T14:57:14.623098Z

Log Message:
-----------
add 6 new DMV projects to the SDK:
automation
automation_air
automation_dmv
automation_flashflexkit
automation_spark
datavisualization

These projects are setup to build in an ant main call.  There are currently several warnings in the datavisualization project that will be cleaned up.  No checkintests exist for these projects as of yet.

I also modified the exisitng projects build files for easier management of the localization targets, bundle and fat-swc. If the projects that I updated:airframework,airspark,framework,playerglobal,rpc,and spark.  All the new projects have been implemented this same way.

QE notes: DMV folks should run through their tests
Doc notes: probably
Bugs: nope
Reviewer:
Tests run: ran the following targets: compile,checkintests,other.locales and doc
Is noteworthy for integration: no

Modified Paths:
--------------
1404 paths were modified

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

--- frameworks/projects/advancedgrids/src/mx/collections/HierarchicalData.as
+++ frameworks/projects/advancedgrids/src/mx/collections/HierarchicalData.as
@@ -0,0 +1,306 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 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.collections
+{
+
+import flash.events.EventDispatcher;
+
+import mx.events.CollectionEvent;
+import mx.events.CollectionEventKind;
+
+
+/**
+ *  Hierarchical data is data already in a structure of parent and child data items.
+ *  The HierarchicalData class provides a default implementation for
+ *  accessing and manipulating data for use in controls such as the AdvancedDataGrid control.
+ *  To configure the AdvancedDataGrid control to display hierarchical data,
+ *  you pass to the dataProvider property an instance of the HierarchicalData class.
+ *
+ *  This implementation handles E4X, XML, and Object nodes in similar but different
+ *  ways. See each method description for details on how the method
+ *  accesses values in nodes of various types.
+ *
+ *  @see mx.controls.AdvancedDataGrid
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class HierarchicalData  extends EventDispatcher implements IHierarchicalData
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param value The data used to populate the HierarchicalData instance.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function HierarchicalData(value:Object = null)
+    {
+        super();
+
+        source = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //--------------------------------------------------------------------------
+    // childrenField
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  The field name to be used to detect children field.
+     */
+    private var _childrenField:String = "children";
+
+    /**
+     *  Indicates the field name to be used to detect children objects in
+     *  a data item.
+     *  By default, all subnodes are considered as children for
+     *  XML data, and the children property is used for the Object data type.
+     *
+     *  This is helpful in adapting to a data format that uses custom data fields
+     *  to represent children.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get childrenField():String
+    {
+        return _childrenField;
+    }
+
+    /**
+     *  @private
+     */
+    public function set childrenField(value:String):void
+    {
+        _childrenField = value;
+    }
+
+    //--------------------------------------------------------------------------
+    // source
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  The source collection.
+     */
+    private var _source:Object;
+
+    /**
+     *  The source collection.
+     *  The collection should implement the IList interface
+     *  to facilitate operation like the addition and removal of items.
+     *
+     *  @see mx.collections.IList
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get source():Object
+    {
+        return _source;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:Object):void
+    {
+        _source = value;
+
+        var event:CollectionEvent = new CollectionEvent(CollectionEvent.COLLECTION_CHANGE);
+        event.kind = CollectionEventKind.RESET;
+        dispatchEvent(event);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function canHaveChildren(node:Object):Boolean
+    {
+        if (node == null)
+            return false;
+
+        var branch:Boolean = false;
+
+        if (node is XML)
+        {
+            var childList:XMLList = childrenField == "children" ? node.children() : node.child(childrenField).children();
+            //accessing non-required e4x attributes is quirky
+            //but we know we'll at least get an XMLList
+            var branchFlag:XMLList = node.@isBranch;
+            //check to see if a flag has been set
+            if (branchFlag.length() == 1)
+            {
+                //check flag and return (this flag overrides termination status)
+                if (branchFlag[0] == "true")
+                    branch = true;
+            }
+            //since no flags, we'll check to see if there are children
+            else if (childList.length() != 0)
+            {
+                branch = true;
+            }
+        }
+        else if (node is Object)
+        {
+            try
+            {
+                if (node[childrenField] != undefined)
+                {
+                    branch = true;
+                }
+            }
+            catch (e:Error)
+            {
+            }
+        }
+        return branch;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getChildren(node:Object):Object
+    {
+        if (node == null)
+            return null;
+
+        var children:*;
+
+        //first get the children based on the type of node.
+        if (node is XML)
+        {
+            children = childrenField == "children" ? node.* : node.child(childrenField).*;
+        }
+        else if (node is Object)
+        {
+            //we'll try the default children property
+            try
+            {
+                children = node[childrenField];
+            }
+            catch (e:Error)
+            {
+            }
+        }
+
+        //no children exist for this node
+        if(children === undefined)
+            return null;
+
+        return children;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function hasChildren(node:Object):Boolean
+    {
+        if (node == null)
+            return false;
+
+        //This default impl can't optimize this call to getChildren
+        //since we can't make any assumptions by type.  Custom impl's
+        //can probably avoid this call and reduce the number of calls to
+        //getChildren if need be.
+        var children:Object = getChildren(node);
+        try
+        {
+            if(children is XMLList || children is XML)
+            {
+                if (children.length() > 0)
+                    return true;
+            }
+
+            if (children.length > 0)
+                return true;
+        }
+        catch (e:Error)
+        {
+        }
+        return false;
+    }
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getData(node:Object):Object
+    {
+        return Object(node);
+    }
+
+    /**
+     * @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function getRoot():Object
+    {
+        return source;
+    }
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10008
Author:   egeorgie@adobe.com
Date:     2009-09-04T07:10:00.322948Z

Log Message:
-----------
Fix for SDK-23005 performance regression after BlendMode changes
Fix: make sure GE and Group DisplayObject sharing works in the blendMode="auto" case.

QE notes: None
Doc notes: None
Bugs: SDK-23005
Reviewer: Evtim
Tests run: checkintests, basictests
Is noteworthy for integration: Yes, blendMode behavior affects Catalyst

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -2874,7 +2874,7 @@
     {
         var result:Boolean = (alwaysCreateDisplayObject ||
         (_filters && _filters.length > 0) ||
-            _blendMode != BlendMode.NORMAL || _mask ||
+            (_blendMode != BlendMode.NORMAL && _blendMode != "auto") || _mask ||
             (layoutFeatures != null && (layoutFeatures.layoutScaleX != 1 || layoutFeatures.layoutScaleY != 1 || layoutFeatures.layoutScaleZ != 1 ||
             layoutFeatures.layoutRotationX != 0 || layoutFeatures.layoutRotationY != 0 || layoutFeatures.layoutRotationZ != 0 ||
             layoutFeatures.layoutZ  != 0)) ||


Transferred from the Adobe Open Source Subversion Repository

Revision: 4046
Author:   jimurphy@adobe.com
Date:     2008-11-07T14:49:20.952872Z

Log Message:
-----------
Merged gumbo_alpha revisions 4019,4021 -> trunk

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_core.swc</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/StyleModule.vm</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_conversion.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/libs/textLayout_edit.swc</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as
@@ -2635,6 +2635,7 @@
 		                	}

 		                	// Size the mask so that it actually renders
+		                	maskComp.validateProperties();
 		                    maskComp.validateSize();
 		                    maskComp.setActualSize(maskComp.getExplicitOrMeasuredWidth(),
 		                                           maskComp.getExplicitOrMeasuredHeight());


Transferred from the Adobe Open Source Subversion Repository

Revision: 12664
Author:   mhorn@adobe.com
Date:     2009-12-08T20:39:06.119601Z

Log Message:
-----------
asdoc updates; new examples; updated examples; bug fixes

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/primitives/examples/RectangularDropShadowExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/RectangularDropShadow.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/primitives/examples/LineExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Line.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Graphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/Rect.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/BitmapImage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as</path>

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

--- frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
+++ frameworks/projects/spark/src/spark/primitives/supportClasses/StrokedElement.as
@@ -26,7 +26,7 @@

 /**
  *  The StrokedElement class is the base class for all graphic elements that
- *  have a stroke.
+ *  have a stroke, including Line, Ellipse, Path, and Rect.
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
@@ -155,6 +155,8 @@
      *  taken during the drawing process. In this step, the stroke properties
      *  are applied.
      *
+     *  @param g The graphic element to draw.
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
@@ -183,6 +185,8 @@
      *  Your override should only contain calls to drawing methods such as
      *  moveTo(), curveTo(), and drawRect().
      *
+     *  @param g The graphic element to draw.
+     *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5


clean version using FMathML FormulaEditor

SVN-Revision: 3125

--- software/sasFlex/src/gov/nih/nci/cbiit/casas/components/FormulaEditor.as
+++ software/sasFlex/src/gov/nih/nci/cbiit/casas/components/FormulaEditor.as
@@ -1,18 +1,76 @@
 package gov.nih.nci.cbiit.casas.components
 {
+
+
+	import fl.core.UIComponent;
+
+	import flash.display.MovieClip;
+	import flash.events.KeyboardEvent;
+	import flash.utils.Timer;
+
 	import learnmath.mathml.components.MathMLEditor;
+	import learnmath.mathml.formula.Constants;
+	import learnmath.windows.ConfigManager;

+	import mx.controls.Alert;
 	import mx.core.IUIComponent;

+	import flash.events.TimerEvent;
+
 	public class FormulaEditor extends MathMLEditor
 	{
 		public function FormulaEditor()
 		{
-//			this.setConfiguration("disableOpen", "false");
-//decompile MathMLEditor
-//decompile EditorApp to enable Save/Open functionalities
-			super();
-//			super.mainPannel.name= "what NCI Center for Biomedical Informatics & Information Technology - Scientific Algorithm Service";
+			//duplicate MathMLEditor Constructor
+			ConfigManager.urlFonts="./";
+			Constants.setUrlFonts("./");
+//			ConfigManager.setConfig("disableSave","false");
+//			ConfigManager.setConfig("disableOpen","false");
+			ConfigManager.disableOpen=new Boolean(false);
+			ConfigManager.disableSave=new Boolean(false);
+			addEventListener(KeyboardEvent.KEY_DOWN, processKey);
+//			mainPannel.name= "NCI Center for Biomedical Informatics & Information Technology - Scientific Algorithm Service";
+//			mainPannel.draw();
+			return;
+		}
+
+//		override protected function createChildren():void
+//		{
+//			Alert.show("before created by super", mainPannel+"");
+//			super.createChildren();
+//			Alert.show("created by super", mainPannel+"");
+//			mainPannel=null;
+//			while (this.numChildren>0)
+//			{
+//				this.removeChildAt(0);
+//			}
+//			var _loc_1:*=new MovieClip();
+//			var editorW:Number=800;
+//			var editorH:Number=500;
+//
+//			mainPannel = new FormulaPanel(_loc_1, 0,0,editorW, editorH, returnFocus);
+//			mainPannel.draw();
+//			mainPannel.setMathML("..xx");
+//			Alert.show(mainPannel+"", mainPannel.getMathML());
+//			var _loc_2:*=new UIComponent();
+//			addChild(_loc_2);
+//
+//			var _loc_3:*=new Timer(100,1);
+//			_loc_3.addEventListenr(TimerEvent.TIMER, redrawEditor);
+//			_loc_3.start();
+//			return;
+//		}
+
+		//override private method
+		private function redrawEditor(event:TimerEvent):void
+		{
+			mainPannel.draw();
+			if (focusManager!=null)
+			{
+				focusManager.setFocus(this);
+			}
+			return;
 		}
 	}
+
 }


Renames RadioButtonGroup.breadthOrderCompare() sorting method to RadioButtonGroup.readOrderCompare() and adds support for sorting items within a RadioButtonGroup by tabIndex as a higher priority to sorting by breadth.  [SDK-31882]

git-svn-id: 7d913817b0a978d84de757191e4bce372605a781@1403837 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/RadioButtonGroup.as
+++ frameworks/projects/spark/src/spark/components/RadioButtonGroup.as
@@ -22,6 +22,7 @@

 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
+import flash.display.InteractiveObject;
 import flash.events.Event;
 import flash.events.EventDispatcher;

@@ -481,8 +482,8 @@

         radioButtons.push(instance);

-        // Apply group indices in "breadth-first" order.
-        radioButtons.sort(breadthOrderCompare);
+		// Apply group indices in "tab order" or "breadth-first" order.
+        radioButtons.sort(readOrderCompare);
         for (var i:int = 0; i < radioButtons.length; i++)
             radioButtons[i].indexNumber = i;

@@ -613,22 +614,25 @@

     /**
      *  @private
-     *  Sandbox root of RadioButton "a" in breadthOrderCompare().
+     *  Sandbox root of RadioButton "a" in readOrderCompare().
      */
     private var aSbRoot:DisplayObject;

     /**
      *  @private
-     *  Sandbox root of RadioButton "b" in breadthOrderCompare().
+     *  Sandbox root of RadioButton "b" in readOrderCompare().
      */
     private var bSbRoot:DisplayObject;

     /**
      *  @private
+	 *  Comparison function used to sort items as they are added to the radioButtons array.
+	 *  Compares by tabIndex or if neither item defines a tabIndex, by "breadthOrder."
+	 *
      *  Returns -1 if a is before b in sort order, 0 if a and b have same
      *  sort order and 1 if a after b in sort order.
      */
-    private function breadthOrderCompare(a:DisplayObject, b:DisplayObject):Number
+    private function readOrderCompare(a:DisplayObject, b:DisplayObject):Number
     {
         var aParent:DisplayObjectContainer = a.parent;
         var bParent:DisplayObjectContainer = b.parent;
@@ -649,7 +653,23 @@
         // If reached the sandbox root of either then done.
         if (aParent == aSbRoot || bParent == bSbRoot)
             return 0;
-
+
+		// first check to see if we can compare by tabIndex
+		var aTabIndex:int = (a is InteractiveObject) ? InteractiveObject(a).tabIndex : -1;
+		var bTabIndex:int = (b is InteractiveObject) ? InteractiveObject(b).tabIndex : -1;
+
+		// if one of the items being compared has a defined tabIndex, compare by tabIndex
+		if(aTabIndex > -1 || bTabIndex > -1)
+		{
+			if (aTabIndex > bTabIndex)
+				return (bTabIndex == -1) ? -1 : 1; // items with assigned tabIndex come before those without
+			if (aTabIndex < bTabIndex)
+				return (aTabIndex == -1) ? 1 : -1; // items without assigned tabIndex come after those without
+			if (a == b)
+				return 0;
+		}
+
+		// if neither item has a defined tabIndex, compare by "breadthOrder"
         var aNestLevel:int = (a is UIComponent) ? UIComponent(a).nestLevel : -1;
         var bNestLevel:int = (b is UIComponent) ? UIComponent(b).nestLevel : -1;

@@ -676,7 +696,7 @@
         else if (a == b)
             return 0;
         else // Nest levels are identical, compare ancestors.
-            return breadthOrderCompare(aParent, bParent);
+            return readOrderCompare(aParent, bParent);
     }

     //--------------------------------------------------------------------------


Transferred from the Adobe Open Source Subversion Repository

Revision: 17331
Author:   jasonsj@adobe.com
Date:     2010-08-16T17:37:24.374535Z

Log Message:
-----------
Added DiscouragedForProfile metadata for use with FB mobile projects.

QE notes: DiscouragedForProfile features should now be visible in FB
Doc notes: ASDoc content omitted for DiscouragedForProfile where the boilerplate comment is desired
Bugs:
Reviewer: gruehle
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ComboBox.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TitleWindow.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataGrid.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/BorderContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/FormHeading.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TabBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Form.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -196,9 +196,14 @@
     //--------------------------------------

     [AccessibilityClass(implementation="spark.accessibility.RichEditableTextAccImpl")]
+
     [DefaultProperty("content")]
+
     [IconFile("RichEditableText.png")]
+
     [DefaultTriggerEvent("change")]
+
+    [DiscouragedForProfile("mobileDevice")]

     /**
      *  RichEditableText is a low-level UIComponent for displaying,


Transferred from the Adobe Open Source Subversion Repository

Revision: 4661
Author:   cframpto@adobe.com
Date:     2009-01-25T21:08:04.606967Z

Log Message:
-----------
Handle TextFlow's damage event for TextView and TextGraphic.  This event indicates the TextFlow was modified programatically.

QE Notes:
Doc Notes:
Bugs: SDK-18749
Reviewers: will be Gordan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>

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

--- frameworks/projects/spark/src/spark/components/RichEditableText.as
+++ frameworks/projects/spark/src/spark/components/RichEditableText.as
@@ -43,6 +43,7 @@
 import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.events.CompositionCompletionEvent;
+import flashx.textLayout.events.DamageEvent;
 import flashx.textLayout.events.FlowOperationEvent;
 import flashx.textLayout.events.SelectionEvent;
 import flashx.textLayout.formats.CharacterFormat;
@@ -1713,6 +1714,8 @@
             CompositionCompletionEvent.COMPOSITION_COMPLETE,
             textFlow_compositionCompleteHandler);

+        textFlow.addEventListener(DamageEvent.DAMAGE, textFlow_damageHandler);
+
         textFlow.addEventListener(Event.SCROLL, textFlow_scrollHandler);

         textFlow.addEventListener(
@@ -2035,6 +2038,25 @@

     /**
      *  @private
+     *  Called when the TextFlow dispatches a 'damage' event.
+     */
+    private function textFlow_damageHandler(
+                        event:DamageEvent):void
+    {
+        trace("damageHandler", event.damageStart, event.damageLength);
+
+        // The text flow changed.  It could have been either/or content or
+        // styles within the flow.
+        textInvalid = true;
+        dispatchEvent(new Event("textInvalid"));
+
+        // Re-measure not needed since it's based on TextView's style
+        // characteristic, not the textFlow's style characteristics.
+        invalidateDisplayList();
+    }
+
+    /**
+     *  @private
      *  Called when the TextFlow dispatches a 'scroll' event
      *  as it autoscrolls.
      */


Fix null pointer exception for process.argv sans run-swf.

--- src/stdio/StandardProcess.as
+++ src/stdio/StandardProcess.as
@@ -85,7 +85,7 @@
     }

     public function get argv(): Array {
-      if (env["stdio.argv"] === "") {
+      if (!env["stdio.argv"]) {
         return []
       } else {
         return env["stdio.argv"].split(" ").map(


Fixed TextPrinter so that it stops listening to stage events after being removed

--- as3/src/asunit4/printers/TextPrinter.as
+++ as3/src/asunit4/printers/TextPrinter.as
@@ -192,17 +192,22 @@
             }
         }

-		private function onAddedToStage(e:Event):void {
+		private function onAddedToStage(event:Event):void {
 			removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
+            addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
 			initializeDisplay();
             updateTextDisplay();
 		}
-
-		private function onStageResize(e:Event):void {
-			backgroundFill.width = stage.stageWidth;
-			backgroundFill.height = stage.stageHeight;
-            textDisplay.width = stage.stageWidth;
-            textDisplay.height = stage.stageHeight;
+
+        private function onRemovedFromStage(event:Event):void {
+            stage.removeEventListener(Event.RESIZE, onStageResize);
+        }
+
+		private function onStageResize(event:Event):void {
+            backgroundFill.width  = stage.stageWidth;
+            backgroundFill.height = stage.stageHeight;
+            textDisplay.width     = stage.stageWidth;
+            textDisplay.height    = stage.stageHeight;
 		}

 		private function initializeDisplay():void {


fixed logging

fixed logging

--- src/main/actionscript/com/castlabs/dash/boxes/TrackFragmentRunBox.as
+++ src/main/actionscript/com/castlabs/dash/boxes/TrackFragmentRunBox.as
@@ -55,7 +55,7 @@

     override protected function parseBox(ba:ByteArray):void {
         if ((flags & 0x1) != 0x1) {
-            throw _context.console.logError(new Error("[TrackFragmentBox]: 'dataOffset' isn't present"));
+            throw _context.console.logAndBuildError("[TrackFragmentBox]: 'dataOffset' isn't present");
         }

         var firstSampleFlagsPresent:Boolean = false;


Fixed bug where global column referrence would trigger callbacks
unnecessarily.

Change-Id: I7340d1a4f121daa06aa2c0959fba8625dcbb81e1

--- WeaveData/src/weave/data/ColumnReferences/AbstractColumnReference.as
+++ WeaveData/src/weave/data/ColumnReferences/AbstractColumnReference.as
@@ -24,6 +24,8 @@
 	import mx.utils.ObjectUtil;

 	import weave.api.WeaveAPI;
+	import weave.api.core.IChildListCallbackInterface;
+	import weave.api.data.IAttributeColumn;
 	import weave.api.data.IColumnReference;
 	import weave.api.data.IDataSource;
 	import weave.api.getCallbackCollection;
@@ -58,7 +60,11 @@
 			// If there is no data source name, trigger callbacks when the list of global objects changes.
 			// This is so global column objects can be detected.
 			if (!dataSourceName.value)
-				getCallbackCollection(this).triggerCallbacks();
+			{
+				var clc:IChildListCallbackInterface = WeaveAPI.globalHashMap.childListCallbacks;
+				if (clc.lastObjectAdded is IAttributeColumn || clc.lastObjectRemoved is IAttributeColumn)
+					getCallbackCollection(this).triggerCallbacks();
+			}
 		}

 		private const dynamicDataSource:LinkableDynamicObject = registerLinkableChild(this, new LinkableDynamicObject(IDataSource));


fixed to use default URLStream if !ExternalInterface.available

--- src/org/hola/JSURLStream.as
+++ src/org/hola/JSURLStream.as
@@ -28,21 +28,22 @@
         private var _req_id : String;

         public function JSURLStream(){
-            _hola_managed = HSettings.enabled;
+            _hola_managed = HSettings.enabled && ExternalInterface.available;
             addEventListener(Event.OPEN, onOpen);
+            super();
+            if (!_hola_managed || js_api_inited)
+                return;
+            // Connect calls to JS.
+            ZErr.log('JSURLStream init api');
             ExternalInterface.marshallExceptions = true;
-            super();
-            // Connect calls to JS.
-            if (ExternalInterface.available && !js_api_inited){
-                ZErr.log('JSURLStream init api');
-                js_api_inited = true;
-                ExternalInterface.addCallback('hola_onFragmentData',
-                    hola_onFragmentData);
-            }
+            ExternalInterface.addCallback('hola_onFragmentData',
+                hola_onFragmentData);
+            js_api_inited = true;
         }

         protected function _trigger(cb:String, data:Object) : void {
-            if (!ExternalInterface.available) {
+            if (!_hola_managed)
+            {
                 // XXX arik: need ZErr.throw
                 ZErr.log('invalid trigger');
                 throw new Error('invalid trigger');
@@ -97,7 +98,7 @@

         override public function load(request : URLRequest) : void {
             // XXX arik: cleanup previous if hola mode changed
-            _hola_managed = HSettings.enabled;
+            _hola_managed = HSettings.enabled && ExternalInterface.available;
             req_count++;
             _req_id = 'req'+req_count;
             if (!_hola_managed)
@@ -112,14 +113,11 @@
         private function onOpen(event : Event) : void { _connected = true; }

         private function decode(str : String) : void {
-            var data : ByteArray;
+            if (!str)
+                return on_decoded_data(null);
             if (!HSettings.use_worker)
-            {
-                if (str)
-                    data = Base64.decode_str(str);
-                return on_decoded_data(data);
-            }
-            data = new ByteArray();
+                return on_decoded_data(Base64.decode_str(str));
+            var data : ByteArray = new ByteArray();
             data.shareable = true;
             data.writeUTFBytes(str);
             WorkerUtils.send({cmd: "b64.decode", id: _req_id});
@@ -130,8 +128,7 @@
             var msg : Object = e.data;
             if (!_req_id || _req_id!=msg.id || msg.cmd!="b64.decode")
                 return;
-            var data : ByteArray = WorkerUtils.recv();
-            on_decoded_data(data);
+            on_decoded_data(WorkerUtils.recv());
         }

         private function on_decoded_data(data : ByteArray) : void {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20843
Author:   mhorn@adobe.com
Date:     2011-03-14T14:36:04.836183Z

Log Message:
-----------
merge

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/NumberFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ISortField.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/CurrencyFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/StringUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/CartesianChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/formatters/DateTimeFormatter.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarChart.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/chartClasses/PolarDataCanvas.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/binding/utils/ChangeWatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/series/PlotSeries.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/OnDemandEventDispatcher.as</path>
<path kind="file" action="M">/private/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TabBar.as</path>

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

--- frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as
+++ frameworks/projects/charts/src/mx/charts/series/CandlestickSeries.as
@@ -163,12 +163,12 @@
     //
     //--------------------------------------------------------------------------

-	/**
-	 *  @private
-	 */
-	private var _moduleFactoryInitialized:Boolean = false;
-
-	/**
+    /**
+     *  @private
+     */
+    private var _moduleFactoryInitialized:Boolean = false;
+
+    /**
      * @private
      */
     private var _localFills:Array /* of IFill */;
@@ -242,7 +242,7 @@
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-	public function get fillFunction():Function
+    public function get fillFunction():Function
     {
         return _fillFunction;
     }
@@ -250,7 +250,7 @@
     /**
      * @private
      */
-   	public function set fillFunction(value:Function):void
+    public function set fillFunction(value:Function):void
     {
         if (value==_fillFunction)
             return;
@@ -271,110 +271,128 @@
     //
     //--------------------------------------------------------------------------

-	/**
-	 *  @private
-	 */
-	private function initStyles():Boolean
-	{
-		HaloDefaults.init(styleManager);
-
-		var candlestickSeriesStyle:CSSStyleDeclaration =
-			HaloDefaults.createSelector("mx.charts.series.CandlestickSeries", styleManager);
-
-		candlestickSeriesStyle.defaultFactory = function():void
-		{
-			this.boxStroke = new Stroke(0, 0);
-			this.declineFill = new SolidColor(0);
-			this.fill = new SolidColor(0xFFFFFF);
-			this.fills = [];
-			this.itemRenderer = new ClassFactory(CandlestickItemRenderer);
-			this.stroke = new Stroke(0, 0);
-		}
-
-		return true;
-	}
-
-
-	/**
-	 *  @inheritDoc
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 9
-	 *  @playerversion AIR 1.1
-	 *  @productversion Flex 3
-	 */
-	override public function set moduleFactory(factory:IFlexModuleFactory):void
-	{
-		super.moduleFactory = factory;
-
-		if (_moduleFactoryInitialized)
-			return;
-
-		_moduleFactoryInitialized = true;
-
-		// our style settings
-		initStyles();
-	}
-
     /**
      *  @private
      */
+    private function initStyles():Boolean
+    {
+        HaloDefaults.init(styleManager);
+
+        var candlestickSeriesStyle:CSSStyleDeclaration =
+            HaloDefaults.createSelector("mx.charts.series.CandlestickSeries", styleManager);
+
+        candlestickSeriesStyle.defaultFactory = function():void
+        {
+            this.boxStroke = new Stroke(0, 0);
+            this.declineFill = new SolidColor(0);
+            this.fill = new SolidColor(0xFFFFFF);
+            this.fills = [];
+            this.itemRenderer = new ClassFactory(CandlestickItemRenderer);
+            this.stroke = new Stroke(0, 0);
+        }
+
+        return true;
+    }
+
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    override public function set moduleFactory(factory:IFlexModuleFactory):void
+    {
+        super.moduleFactory = factory;
+
+        if (_moduleFactoryInitialized)
+            return;
+
+        _moduleFactoryInitialized = true;
+
+        // our style settings
+        initStyles();
+    }
+
+    /**
+     *  @private
+     */
     override public function getAllDataPoints():Array /* of HitData */
     {
-    	if (!_renderData)
-    		return [];
-    	if (!(_renderData.filteredCache))
-    		return [];
-
-    	var itemArr:Array /* of CandlestickSeriesItem */ = [];
-    	if (chart && chart.dataTipItemsSet && dataTipItems)
-    		itemArr = dataTipItems;
-    	else if (chart && chart.showAllDataTips && _renderData.filteredCache)
-    		itemArr = _renderData.filteredCache;
-    	else
-    		itemArr = [];
-
-    	var n:uint = itemArr.length;
-    	var i:uint;
-    	var result:Array /* of HitData */ = [];
-
-    	for (i = 0; i < n; i++)
+        if (!_renderData)
+            return [];
+        if (!(_renderData.filteredCache))
+            return [];
+
+        var itemArr:Array /* of CandlestickSeriesItem */ = [];
+        if (chart && chart.dataTipItemsSet && dataTipItems)
+            itemArr = dataTipItems;
+        else if (chart && chart.showAllDataTips && _renderData.filteredCache)
+            itemArr = _renderData.filteredCache;
+        else
+            itemArr = [];
+
+        var n:uint = itemArr.length;
+        var i:uint;
+        var result:Array /* of HitData */ = [];
+
+        for (i = 0; i < n; i++)
         {
             var v:HLOCSeriesItem = itemArr[i];
             if (_renderData.filteredCache.indexOf(v) == -1)
             {
-            	var itemExists:Boolean = false;
-            	var m:int  = _renderData.filteredCache.length;
-            	for (var j:int = 0; j < m; j++)
-            	{
-            		if (v.item == _renderData.filteredCache[j].item)
-            		{
-            			v = _renderData.filteredCache[j];
-            			itemExists = true;
-            			break;
-            		}
-            	}
-            	if (!itemExists)
-            		continue;
+                var itemExists:Boolean = false;
+                var m:int  = _renderData.filteredCache.length;
+                for (var j:int = 0; j < m; j++)
+                {
+                    if (v.item == _renderData.filteredCache[j].item)
+                    {
+                        v = _renderData.filteredCache[j];
+                        itemExists = true;
+                        break;
+                    }
+                }
+                if (!itemExists)
+                    continue;
             }
             if (v)
-        	{
-            	var ypos:Number = (v.open + v.close)/2;
-            	var id:uint = v.index;
-            	var hd:HitData = new HitData(createDataID(id),Math.sqrt(0),v.x + _renderData.renderedXOffset,ypos,v);
-            	var f:Object = getStyle("declineFill");
-
-           	 	hd.contextColor = GraphicsUtilities.colorFromFill(HLOCSeriesItem(hd.chartItem).fill);
-
-            	hd.dataTipFunction = formatDataTip;
-            	result.push(hd);
-        	}
+            {
+                var ypos:Number = (v.open + v.close)/2;
+                var id:uint = v.index;
+                var hd:HitData = new HitData(createDataID(id),Math.sqrt(0),v.x + _renderData.renderedXOffset,ypos,v);
+                var f:Object = getStyle("declineFill");
+
+                hd.contextColor = GraphicsUtilities.colorFromFill(HLOCSeriesItem(hd.chartItem).fill);
+
+                hd.dataTipFunction = formatDataTip;
+                result.push(hd);
+            }
         }
         return result;
     }

     /*
-     *  @copy mx.charts.chartClasses.IChartElement#findDataPoints()
+     *  Returns a HitData object describing the nearest data point
+     *  to the coordinates passed to the method.
+     *  The x and y arguments
+     *  should be values in the Element's coordinate system.
+     *  This method aheres to the limits specified by the
+     *  sensitivity2 parameter
+     *  when looking for nearby data points.
+     *
+     *  @param x The x coordinate relative to the ChartBase object.
+     *
+     *  @param y The y coordinate relative to the ChartBase object.
+     *
+     *  @param sensitivity The maximum distance from the data point that the
+     *  x/y coordinate location can be.
+     *
+     *  @return A HitData object describing the nearest data point
+     *  within sensitivity pixels.
+     *
+     *  @see mx.charts.HitData
      *
      *  @langversion 3.0
      *  @playerversion Flash 9
@@ -454,9 +472,9 @@
     {
         _localFills = getStyle('fills');
         if (_localFills != null)
-        	_fillCount = _localFills.length;
+            _fillCount = _localFills.length;
         else
-        	_fillCount = 0;
+            _fillCount = 0;
         super.stylesInitialized();
     }

@@ -471,9 +489,9 @@
         {
             _localFills = getStyle('fills');
             if (_localFills != null)
-        		_fillCount = _localFills.length;
-        	else
-        		_fillCount = 0;
+                _fillCount = _localFills.length;
+            else
+                _fillCount = 0;
             invalidateDisplayList();
             legendDataChanged();
         }
@@ -498,15 +516,15 @@
         var b:Number;

         if(dataTransform && dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS) is NumericAxis &&
-        	(dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS) as NumericAxis).direction == "inverted")
-        {
-        	a = item.open;
-        	b = item.close;
+            (dataTransform.getAxis(CartesianTransform.VERTICAL_AXIS) as NumericAxis).direction == "inverted")
+        {
+            a = item.open;
+            b = item.close;
         }
         else
         {
-        	a = item.close;
-        	b = item.open;
+            a = item.close;
+            b = item.open;
         }
         if (a > b)
             return(GraphicsUtilities.fillFromStyle(getStyle("declineFill")));


Transferred from the Adobe Open Source Subversion Repository

Revision: 6260
Author:   rfrishbe@adobe.com
Date:     2009-04-24T22:08:41.005574Z

Log Message:
-----------
Automation assumed that a component implemented both IUIComponent and IAutomationObject; however, we'd like to automate FlexNativeMenu and FNM doesn't implement IUIComponent.  The properties automation needed from IUIComponent, were enabled, parent, owner, and visible.  We now have properties on IAutomationObject called automationEnabled, automationParent, automationOwner, and automationVisible for this purpose.  Now automation only needs to rely on IAutomationObject.

QE Notes: -
Doc Notes: -
Bugs: SDK-20488
Reviewer: Evtim
tests: checkintests

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/automation/IAutomationObject.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/framework_textLayout/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.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/airframework/src/mx/controls/FlexNativeMenu.as</path>

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

--- frameworks/projects/framework/src/mx/automation/IAutomationObject.as
+++ frameworks/projects/framework/src/mx/automation/IAutomationObject.as
@@ -12,9 +12,9 @@
 package mx.automation
 {

-import flash.events.Event;
 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
+import flash.events.Event;
 import flash.events.MouseEvent;

 /**
@@ -89,56 +89,7 @@
      *  @productversion Flex 3
      */
     function get automationValue():Array;
-
-    /**
-     *  Returns a set of properties that identify the child within
-     *  this container.  These values should not change during the
-     *  lifespan of the application.
-     *
-     *  @param child Child for which to provide the id.
-     *
-     *  @return Sets of properties describing the child which can
-     *          later be used to resolve the component.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    function createAutomationIDPart(child:IAutomationObject):Object;
-
-    /**
-     *  Resolves a child by using the id provided. The id is a set
-     *  of properties as provided by the createAutomationIDPart() method.
-     *
-     *  @param criteria Set of properties describing the child.
-     *         The criteria can contain regular expression values
-     *         resulting in multiple children being matched.
-     *  @return Array of children that matched the criteria
-     *          or null if no children could not be resolved.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    function resolveAutomationIDPart(criteria:Object):Array;
-
-    /**
-     *  Provides the automation object at the specified index.  This list
-     *  should not include any children that are composites.
-     *
-     *  @param index The index of the child to return
-     *
-     *  @return The child at the specified index.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
-     */
-    function getAutomationChildAt(index:int):IAutomationObject;
-
+
     /**
      *  The number of automation children this container has.
      *  This sum should not include any composite children, though
@@ -180,10 +131,10 @@
     function set showInAutomationHierarchy(value:Boolean):void;

     /**
-     * An implementation of the IAutomationTabularData interface, which
-     * can be used to retrieve the data.
-     *
-     * @return An implementation of the IAutomationTabularData interface.
+     *  An implementation of the IAutomationTabularData interface, which
+     *  can be used to retrieve the data.
+     *
+     *  @return An implementation of the IAutomationTabularData interface.
      *
      *  @langversion 3.0
      *  @playerversion Flash 9
@@ -191,6 +142,121 @@
      *  @productversion Flex 3
      */
     function get automationTabularData():Object;
+
+    /**
+     *  The owner of this component for automation purposes.
+     *
+     *  @see mx.core.IVisualElement#owner
+     *
+     *  @return The owner of this component
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4
+     */
+    function get automationOwner():DisplayObjectContainer;
+
+    /**
+     *  The parent of this component for automation purposes.
+     *
+     *  @see mx.core.IVisualElement#parent
+     *
+     *  @return The parent of this component
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4
+     */
+    function get automationParent():DisplayObjectContainer;
+
+    /**
+     *  True if this component is enabled for automation, false
+     *  otherwise.
+     *
+     *  @see mx.core.IUIComponent#enabled
+     *
+     *  @return true if this component is enabled for automation,
+     *          false otherwise.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4
+     */
+    function get automationEnabled():Boolean;
+
+    /**
+     *  True if this component is visible for automation, false
+     *  otherwise.
+     *
+     *  @see flash.display.DisplayObject#visible
+     *
+     *  @return true if this component is visible for automation,
+     *          false otherwise.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 4
+     */
+    function get automationVisible():Boolean;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns a set of properties that identify the child within
+     *  this container.  These values should not change during the
+     *  lifespan of the application.
+     *
+     *  @param child Child for which to provide the id.
+     *
+     *  @return Sets of properties describing the child which can
+     *          later be used to resolve the component.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function createAutomationIDPart(child:IAutomationObject):Object;
+
+    /**
+     *  Resolves a child by using the id provided. The id is a set
+     *  of properties as provided by the createAutomationIDPart() method.
+     *
+     *  @param criteria Set of properties describing the child.
+     *         The criteria can contain regular expression values
+     *         resulting in multiple children being matched.
+     *  @return Array of children that matched the criteria
+     *          or null if no children could not be resolved.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function resolveAutomationIDPart(criteria:Object):Array;
+
+    /**
+     *  Provides the automation object at the specified index.  This list
+     *  should not include any children that are composites.
+     *
+     *  @param index The index of the child to return
+     *
+     *  @return The child at the specified index.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function getAutomationChildAt(index:int):IAutomationObject;

     /**
      *  Replays the specified event.  A component author should probably call


Transferred from the Adobe Open Source Subversion Repository

Revision: 18230
Author:   gruehle@adobe.com
Date:     2010-10-19T22:49:21.316189Z

Log Message:
-----------
Make the following skin parts bindable:
 SkinnableContainer.contentGroup
 SkinnableDataContainer.dataGroup
 SkinnableTextBase.textDisplay

QE notes: none
Doc notes: none
Bugs: SDK-25288
Reviewer:  jszeto
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/SkinnableContainer.as
+++ frameworks/projects/spark/src/spark/components/SkinnableContainer.as
@@ -377,6 +377,7 @@
     //
     //--------------------------------------------------------------------------

+	[Bindable]
     [SkinPart(required="false")]

     /**


added test_kdtree()

added test_kdtree()

--- WeaveData/src/weave/data/AttributeColumns/StreamedGeometryColumn.as
+++ WeaveData/src/weave/data/AttributeColumns/StreamedGeometryColumn.as
@@ -16,6 +16,7 @@
 package weave.data.AttributeColumns
 {
 	import flash.utils.ByteArray;
+	import flash.utils.getTimer;

 	import mx.rpc.AsyncToken;
 	import mx.rpc.events.FaultEvent;
@@ -24,15 +25,21 @@
 	import weave.api.core.ICallbackCollection;
 	import weave.api.data.ColumnMetadata;
 	import weave.api.data.IQualifiedKey;
+	import weave.api.disposeObject;
 	import weave.api.newLinkableChild;
 	import weave.api.primitives.IBounds2D;
 	import weave.api.registerLinkableChild;
 	import weave.api.reportError;
 	import weave.api.services.IWeaveGeometryTileService;
+	import weave.compiler.StandardLib;
 	import weave.core.LinkableNumber;
 	import weave.core.LinkableString;
+	import weave.primitives.Bounds2D;
+	import weave.primitives.GeneralizedGeometry;
+	import weave.primitives.KDTree;
 	import weave.services.addAsyncResponder;
-	import weave.utils.GeometryStreamDecoder;
+	import weave.utils.GeometryStreamDecoder;
+	import weave.utils.VectorUtils;

 	/**
 	 * StreamedGeometryColumn
@@ -276,6 +283,48 @@
 		private static function verifyMinimumScreenArea(value:Number):Boolean
 		{
 			return value >= 1;
+		}
+
+		public static function test_kdtree(iterations:int = 10):Object
+		{
+			var cols:Array = WeaveAPI.SessionManager.getLinkableDescendants(WeaveAPI.globalHashMap, StreamedGeometryColumn);
+			for each (var sgc:StreamedGeometryColumn in cols)
+				return sgc.test_kdtree(iterations);
+			return "No StreamedGeometryColumn to test";
+		}
+
+		public function test_kdtree(iterations:int = 10):Object
+		{
+			var todo:Array = [];
+			for each (var geom:GeneralizedGeometry in _geometryStreamDecoder.geometries)
+			{
+				var bounds:Bounds2D = geom.bounds as Bounds2D;
+				var key:Array = [bounds.getXNumericMin(), bounds.getYNumericMin(), bounds.getXNumericMax(), bounds.getYNumericMax(), bounds.getArea()];
+				todo.push([key, geom]);
+			}
+
+			// ------
+
+			var results:Array = [];
+			for (var i:int = 0; i < iterations; i++)
+			{
+				VectorUtils.randomSort(todo);
+				var t:int = getTimer();
+				var kdtree:KDTree = new KDTree(5);
+				for each (var params:Array in todo)
+					kdtree.insert(params[0], params[1]);
+				t = getTimer() - t;
+				disposeObject(kdtree);
+				results.push(t);
+			}
+
+			return {
+				node_count: todo.length,
+				times_in_ms: results.join(', '),
+				time_mean_ms: StandardLib.mean(results),
+				time_min_ms: Math.min.apply(null, results),
+				time_max_ms: Math.max.apply(null, results)
+			};
 		}
 	}
 }


Minor player code cleanup.

Minor player code cleanup.

--- src/Player.as
+++ src/Player.as
@@ -88,6 +88,10 @@
       this.acceleration.y = this.naturalForces.y;
       this.oDrag.x = this.drag.x;
       this.jumpDrag.x = this.oDrag.x * 2;
+      if (this.animDelegate == null)
+      {
+        throw new Error('Player animation delegate is required.');
+      }
       this.animDelegate.playerIsFalling();
     }

@@ -144,8 +148,10 @@
       // - Basically handle starting and ending of jump, and starting of
       // falling. The tracking of pVelocity is an extra complexity. The
       // possibility of hitting the ceiling during jump is another one.
-      if (FlxG.keys.justPressed('UP') && jumpTimer.finished &&
-          this.isTouching(FlxObject.FLOOR))
+      if (
+        FlxG.keys.justPressed('UP') && jumpTimer.finished &&
+        this.isTouching(FlxObject.FLOOR)
+      )
       {
         // Try to jump.
         jumpStart();
@@ -229,9 +235,11 @@
     }
     public function face(direction:uint):void
     {
-      if (this.velocity.x != 0 &&
-          this.nextAction != STOP &&
-          this.facing != direction)
+      if (
+        this.velocity.x != 0 &&
+        this.nextAction != STOP &&
+        this.facing != direction
+      )
       {
         this.nextAction = STOP;
         if (!this.inMidAir())


Transferred from the Adobe Open Source Subversion Repository

Revision: 20482
Author:   dloverin@adobe.com
Date:     2011-02-28T17:16:14.975868Z

Log Message:
-----------
Add properties to control allowing domains for new RSLs.

Add two Boolean properties to the IFlexModuleFactory interface.
•        Add the allowDomainsInNewRSLs property to control applying the domains gathered from allowDomain() calls to new RSLs.

•        Add the allowInsecureDomainsInNewRSLs property to control applying the domains gathered from allowInsecureDomain() calls to new RSLs.

QE notes: None.
Doc notes: None.
Bugs:
Reviewer: Alex
Tests run: cyclone
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/IFlexModuleFactory.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
@@ -213,6 +213,66 @@
     //-----------------------------------
     //  ISystemManager implementations
     //-----------------------------------
+
+    //----------------------------------
+    //  allowDomainsInNewRSLs
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _allowDomainsInNewRSLs:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
+    public function get allowDomainsInNewRSLs():Boolean
+    {
+        return _allowDomainsInNewRSLs;
+    }
+
+    /**
+     *  @private
+     */
+    public function set allowDomainsInNewRSLs(value:Boolean):void
+    {
+        _allowDomainsInNewRSLs = value;
+    }
+
+    //----------------------------------
+    //  allowInsecureDomainsInNewRSLs
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _allowInsecureDomainsInNewRSLs:Boolean = true;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
+    public function get allowInsecureDomainsInNewRSLs():Boolean
+    {
+        return _allowInsecureDomainsInNewRSLs;
+    }
+
+    /**
+     *  @private
+     */
+    public function set allowInsecureDomainsInNewRSLs(value:Boolean):void
+    {
+        _allowInsecureDomainsInNewRSLs = value;
+    }

     //----------------------------------
     //  cursorChildren