Transferred from the Adobe Open Source Subversion Repository

Revision: 18641
Author:   chiedozi@adobe.com
Date:     2010-11-17T01:26:13.734827Z

Log Message:
-----------
Updated MobileApplication api names.

MobileApplicationBase
backKeyHandler renamed to backKeyUpHandler
menuKeyHandler renamed to menuKeyUpHandler
sessionCachingEnabled renamed to persistNavigatorState
persistApplicationState() renamed to saveNavigatorState
restoreApplicationSate() renamed to loadNavigatorState
registerPersistenceClassAliases removed
nativeApplication_invokeHandler() renamed to invokeHandler()
nativeApplication_deactivateHandler() renamed to deactivateHandler()

PersistenceManager
flush() renamed to save() and return success boolean
initialize() renamed to load() and return success boolean
The applicationVersion shared object property was renamed to versionNumber.

View
deserializePersistedData() renamed to deserializeData()

ViewNavigatorBase
restoreViewData() renamed loadViewData()

Events
APPLICATION_PERSIST and APPLICATION_RESTORE removed from the framework
APPLICATION_PERSISTING renamed to NAVIGATOR_STATE_SAVING
APPLICATION_RESTORING renamed to NAVIGATOR_STATE_LOADING

QE notes:
Doc notes:
Bugs:
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers/IPersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers/PersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/events/FlexEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
@@ -19,6 +19,7 @@
 import flash.events.KeyboardEvent;
 import flash.events.MouseEvent;
 import flash.events.StageOrientationEvent;
+import flash.net.registerClassAlias;
 import flash.system.Capabilities;
 import flash.ui.Keyboard;

@@ -51,19 +52,19 @@
 //--------------------------------------

 /**
- *  Dispatched after the application state data has been written
- *  to the application's persistence manager.  This event is only
- *  dispatched if the sessionCachingEnabled
- *  property is set to true on the application.
+ *  This cancelable event dispatched before the application attempts
+ *  to restore its previously saved state when the application is being
+ *  launched.  Calling preventDefault on this event will
+ *  prevent the application state from being restored.
  *
- *  @eventType mx.events.FlexEvent.APPLICATION_PERSIST
+ *  @eventType mx.events.FlexEvent.NAVIGATOR_STATE_LOADING
  *
  *  @langversion 3.0
  *  @playerversion Flash 10.1
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-[Event(name="applicationPersist", type="mx.events.FlexEvent")]
+[Event(name="navigatorStateLoading", type="mx.events.FlexEvent")]

 /**
  *  This cancelable event dispatched before the application attempts
@@ -71,46 +72,14 @@
  *  Calling preventDefault on this event will prevent the
  *  application state from being saved.
  *
- *  @eventType mx.events.FlexEvent.APPLICATION_PERSISTING
+ *  @eventType mx.events.FlexEvent.NAVIGATOR_STATE_SAVING
  *
  *  @langversion 3.0
  *  @playerversion Flash 10.1
  *  @playerversion AIR 2.5
  *  @productversion Flex 4.5
  */
-[Event(name="applicationPersisting", type="mx.events.FlexEvent")]
-
-/**
- *  Dispatched after the application state data has been restored
- *  from disk by the application's persistence manager.  At the point
- *  this event is dispatched, all data related to the application state
- *  should be valid.  This event is only dispatched if the
- *  sessionCachingEnabled property is set to true when
- *  the application is initialized.
- *
- *  @eventType mx.events.FlexEvent.APPLICATION_RESTORE
- *
- *  @langversion 3.0
- *  @playerversion Flash 10.1
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
-[Event(name="applicationRestore", type="mx.events.FlexEvent")]
-
-/**
- *  This cancelable event dispatched before the application attempts
- *  to restore its previously saved state when the application is being
- *  launched.  Calling preventDefault on this event will
- *  prevent the application state from being restored.
- *
- *  @eventType mx.events.FlexEvent.APPLICATION_RESTORING
- *
- *  @langversion 3.0
- *  @playerversion Flash 10.1
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
-[Event(name="applicationRestoring", type="mx.events.FlexEvent")]
+[Event(name="navigatorStateSaving", type="mx.events.FlexEvent")]

 /**
  *  The base application class used for all view based application types.
@@ -237,7 +206,7 @@
      *
      *
The persistence manager will automatically save and restore
      *  the main navigator's persistence stack if the
-     *  sessionCachingEnabled flag is set to true. Data stored
+     *  persistNavigatorState flag is set to true. Data stored
      *  in the persistence manager will automatically be flushed to disk
      *  when the application is suspended or exited.

      *
@@ -258,7 +227,6 @@
     {
         if (!_persistenceManager)
         {
-            registerPersistenceClassAliases();
             _persistenceManager = createPersistenceManager();
         }

@@ -266,10 +234,10 @@
     }

     //----------------------------------
-    //  sessionCachingEnabled
+    //  persistNavigatorState
     //----------------------------------

-    private var _sessionCachingEnabled:Boolean = false;
+    private var _persistNavigatorState:Boolean = false;

     /**
      *  Toggles the application session caching feature for the application.  When
@@ -292,7 +260,7 @@
      *  FlexEvent.APPLICATION_RESTORE event.  Canceling the APPLICATION_RESTORING
      *  event will prevent the navigation data from being restored.

      *
-     *
The sessionCachingEnabled flag must be set to true before
+     *
The persistNavigatorState flag must be set to true before
      *  the application initializes itself for the navigator's state to be automatically
      *  restored.

      *
@@ -301,17 +269,17 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    public function get sessionCachingEnabled():Boolean
-    {
-        return _sessionCachingEnabled;
+    public function get persistNavigatorState():Boolean
+    {
+        return _persistNavigatorState;
     }

     /**
      * @private
      */
-    public function set sessionCachingEnabled(value:Boolean):void
-    {
-        _sessionCachingEnabled = value;
+    public function set persistNavigatorState(value:Boolean):void
+    {
+        _persistNavigatorState = value;
     }

     //----------------------------------
@@ -363,13 +331,13 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function nativeApplication_invokeHandler(event:InvokeEvent):void
+    protected function invokeHandler(event:InvokeEvent):void
     {
     }

     /**
      *  This method is called when the application is exiting or being
-     *  sent to the background by the OS.  If sessionCachingEnabled
+     *  sent to the background by the OS.  If persistNavigatorState
      *  is set to true, the application will begin the state saving process
      *  here.
      *
@@ -378,30 +346,27 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function nativeApplication_deactivateHandler(event:Event):void
+    protected function deactivateHandler(event:Event):void
     {
         // Check if the application state should be persisted
-        if (sessionCachingEnabled)
+        if (persistNavigatorState)
         {
             // Dispatch event for saving persistence data
             var eventCanceled:Boolean = false;
-            if (hasEventListener(FlexEvent.APPLICATION_PERSISTING))
-                eventCanceled = !dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_PERSISTING,
+            if (hasEventListener(FlexEvent.NAVIGATOR_STATE_SAVING))
+                eventCanceled = !dispatchEvent(new FlexEvent(FlexEvent.NAVIGATOR_STATE_SAVING,
                                                                 false, true));

             if (!eventCanceled)
             {
-                persistApplicationState();
-
-                if (hasEventListener(FlexEvent.APPLICATION_PERSIST))
-                    dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_PERSIST));
+                saveNavigatorState();
             }
         }

         // Always flush the persistence manager to disk if it exists
         if (_persistenceManager)
         {
-            persistenceManager.flush();
+            persistenceManager.save();
         }
     }

@@ -414,7 +379,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function backKeyHandler(event:KeyboardEvent):void
+    protected function backKeyUpHandler(event:KeyboardEvent):void
     {
     }

@@ -427,7 +392,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function menuKeyHandler(event:KeyboardEvent):void
+    protected function menuKeyUpHandler(event:KeyboardEvent):void
     {
         if (activeView && !activeView.menuKeyHandledByView())
             viewMenuOpen = !viewMenuOpen;
@@ -436,7 +401,7 @@
     /**
      *  Method is responsible for create the persistence manager for the application.
      *  This method will automatically be called when the persistence manager is
-     *  accessed for the first time or if the sessionCachingEnabled flag
+     *  accessed for the first time or if the persistNavigatorState flag
      *  is set to true on the application.
      *
      *  @langversion 3.0
@@ -451,7 +416,7 @@

     /**
      *  Responsible for persisting the application state to the persistence manager.
-     *  This method is automatically called when sessionCachingEnabled
+     *  This method is automatically called when persistNavigatorState
      *  is set to true.  By default, this method will save the application version
      *  and the time the persistence object was created to the "timestamp" and
      *  "applicationVersion" keys.
@@ -464,37 +429,19 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function persistApplicationState():void
+    protected function saveNavigatorState():void
     {
         // Save version number of application
         var appDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
         var ns:Namespace = appDescriptor.namespace();

-        persistenceManager.setProperty("applicationVersion",
+        persistenceManager.setProperty("versionNumber",
                                         appDescriptor.ns::versionNumber.toString());
     }

     /**
-     *  Method is responsible for registering the class types that may be
-     *  saved to a persistence manager that uses a shared object as its data store.
-     *  Since shared objects use the standard AMF encoding rules, custom class types
-     *  must be registered with the runtime so that they are properly read in.  This
-     *  method is called before the persistence manager is initialized so that the
-     *  application has a chance to use flash.net.registerClassAlias()
-     *  before the persistence data is loaded.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function registerPersistenceClassAliases():void
-    {
-    }
-
-    /**
      *  Responsible for restoring the application's state when the
-     *  sessionCachingEnabled flag is set to true.
+     *  persistNavigatorState flag is set to true.
      *
      *
This method will only be called if the FlexEvent.APPLICATION_RESTORING
      *  event is not canceled.

@@ -504,7 +451,7 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function restoreApplicationState():void
+    protected function loadNavigatorState():void
     {
     }

@@ -530,7 +477,7 @@
         systemManager.stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE,
             orientationChangeHandler);
         NativeApplication.nativeApplication.
-            addEventListener(InvokeEvent.INVOKE, nativeApplication_invokeHandler);
+            addEventListener(InvokeEvent.INVOKE, invokeHandler);

         // We need to listen to different events on desktop and mobile because
         // on desktop, the deactivate event is dispatched whenever the window loses
@@ -541,10 +488,10 @@
         // FIXME (chiedozi): enumerate all possible os values
         if (os.indexOf("Windows") != -1 || os.indexOf("Mac OS") != -1)
             NativeApplication.nativeApplication.
-                addEventListener(Event.EXITING, nativeApplication_deactivateHandler);
+                addEventListener(Event.EXITING, deactivateHandler);
         else
             NativeApplication.nativeApplication.
-                addEventListener(Event.DEACTIVATE, nativeApplication_deactivateHandler);
+                addEventListener(Event.DEACTIVATE, deactivateHandler);
     }

     /**
@@ -596,9 +543,9 @@
         // The backKeyEventPreventDefaulted key is always set in the
         // deviceKeyDownHandler method and so doesn't need to be reset.
         if (key == Keyboard.BACK && !backKeyEventPreventDefaulted && !exitApplicationOnBackKey)
-            backKeyHandler(event);
+            backKeyUpHandler(event);
         else if (key == Keyboard.MENU && !menuKeyEventPreventDefaulted)
-            menuKeyHandler(event);
+            menuKeyUpHandler(event);
     }

     /**
@@ -729,24 +676,24 @@

         addApplicationListeners();

-        if (sessionCachingEnabled)
+        if (persistNavigatorState)
         {
-            registerPersistenceClassAliases();
+            // Register aliases for custom classes that will be written to
+            // persistence store by navigator
+            registerClassAlias("ViewDescriptor", ViewDescriptor);
+            registerClassAlias("NavigationStack", NavigationStack);

-            persistenceManager.initialize();
+            persistenceManager.load();

             // Dispatch event for loading persistence data
             var eventDispatched:Boolean = true;
-            if (hasEventListener(FlexEvent.APPLICATION_RESTORING))
-                eventDispatched = dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_RESTORING,
+            if (hasEventListener(FlexEvent.NAVIGATOR_STATE_LOADING))
+                eventDispatched = dispatchEvent(new FlexEvent(FlexEvent.NAVIGATOR_STATE_LOADING,
                                                 false, true));

             if (eventDispatched)
             {
-                restoreApplicationState();
-
-                if (hasEventListener(FlexEvent.APPLICATION_RESTORE))
-                    eventDispatched = dispatchEvent(new FlexEvent(FlexEvent.APPLICATION_RESTORE));
+                loadNavigatorState();
             }
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10603
Author:   stshongr@adobe.com
Date:     2009-09-25T21:27:29.073340Z

Log Message:
-----------
Add checkin test for TileGroup
Add ASDoc examples for TileGroup/VGroup/HGroup

QE notes: None
Doc notes: None
Bugs: None
Reviewer: Kevin
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/TileGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TileGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/VGroupExample.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/TileGroupTestScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/HGroupExample.mxml</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/tests/basicTests/BasicTests-config.xml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/spark/views/TileGroupTests.mxml</path>

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

--- frameworks/projects/spark/src/spark/components/HGroup.as
+++ frameworks/projects/spark/src/spark/components/HGroup.as
@@ -45,6 +45,7 @@
  *  </pre>
  *
  *  @see spark.layouts.HorizontalLayout
+ *  @includeExample examples/HGroupExample.mxml
  *
  *  @langversion 3.0
  *  @playerversion Flash 10


changed saturate() + add() into a or()

changed saturate() + add() into a or()

--- src/aerys/minko/render/shader/part/ShaderPart.as
+++ src/aerys/minko/render/shader/part/ShaderPart.as
@@ -727,7 +727,7 @@

 		protected final function lessEqual(a : Object, b : Object) : SFloat
 		{
-			return saturate(add(lessThan(a, b), equal(a, b)));
+			return or(lessThan(a, b), equal(a, b));
 		}

 		protected final function equal(a : Object, b : Object) : SFloat


remove attack animation

remove attack animation

--- src/battlecode/client/viewer/render/DrawState.as
+++ src/battlecode/client/viewer/render/DrawState.as
@@ -184,10 +184,6 @@
         /////////////////// SIGNAL HANDLERS ///////////////////
         ///////////////////////////////////////////////////////

-        override public function visitAttackSignal(s:AttackSignal):* {
-            getRobot(s.getRobotID()).attack(s.getTargetLoc());
-        }
-
         override public function visitBroadcastSignal(s:BroadcastSignal):* {
             getRobot(s.getRobotID()).broadcast();
         }
@@ -208,11 +204,11 @@
         }

         override public function visitEnergonChangeSignal(s:EnergonChangeSignal):* {
-
+            // TODO
         }

         override public function visitFluxChangeSignal(s:FluxChangeSignal):* {
-
+            // TODO
         }

         override public function visitIndicatorStringSignal(s:IndicatorStringSignal):* {


Transferred from the Adobe Open Source Subversion Repository

Revision: 14483
Author:   smgilson@adobe.com
Date:     2010-03-01T19:01:18.459430Z

Log Message:
-----------
merge 14456: Adding ASDoc version tags classes

QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkRangeAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkRadioButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkPanelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarAutomationImpl.as</path>
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirFunctionsHelper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSkinnableContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkValueChangeAutomationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkButtonBarBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkNavigatorContentAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkDataGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTrackBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation/src/mx/automation/events/EventDetails.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/events/SparkListItemSelectEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTabBarAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonBarButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableContainerBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/mediaClasses/SparkMuteButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_air/src/mx/automation/air/AirDragManagerAutomationHandler.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/soap/SOAPResult.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTextBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTitleWindowAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkTileGroupAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkToggleButtonAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkSpinnerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccConst.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkLabelAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkBorderContainerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkGroupBaseAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/SparkVideoPlayerAutomationImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkSkinnableComponentAutomationImpl.as</path>

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

--- frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTrackBaseAutomationImpl.as
+++ frameworks/projects/automation_spark/src/spark/automation/delegates/components/supportClasses/SparkTrackBaseAutomationImpl.as
@@ -11,55 +11,70 @@

 package spark.automation.delegates.components.supportClasses
 {
-	import flash.display.DisplayObject;
-
-	import mx.automation.Automation;
-	import mx.core.mx_internal;
-
-	import spark.components.supportClasses.TrackBase;
-
-	use namespace mx_internal;
-
-	[Mixin]
-	/**
-	 *
-	 *  Defines methods and properties required to perform instrumentation for the
-	 *  TrackBase control.
-	 *
-	 *  @see spark.components.supportClasses.TrackBase
-	 *
-	 */
-	public class SparkTrackBaseAutomationImpl extends SparkRangeAutomationImpl
-	{
-
-		include "../../../../core/Version.as";
-		//--------------------------------------------------------------------------
-		//
-		//  Class methods
-		//
-		//--------------------------------------------------------------------------
-
-		/**
-		 *  Registers the delegate class for a component class with automation manager.
-		 *
-		 *  @param root The SystemManger of the application.
-		 */
-		public static function init(root:DisplayObject):void
-		{
-			Automation.registerDelegateClass(spark.components.supportClasses.TrackBase, SparkTrackBaseAutomationImpl);
-		}
-
-		/**
-		 *  Constructor.
-		 * @param obj TrackBase object to be automated.
-		 */
-		public function SparkTrackBaseAutomationImpl(obj:spark.components.supportClasses.TrackBase)
-		{
-			super(obj);
-
-		}
-
-
-	}
-
+    import flash.display.DisplayObject;
+
+    import mx.automation.Automation;
+    import mx.core.mx_internal;
+
+    import spark.components.supportClasses.TrackBase;
+
+    use namespace mx_internal;
+
+    [Mixin]
+    /**
+     *
+     *  Defines methods and properties required to perform instrumentation for the
+     *  TrackBase control.
+     *
+     *  @see spark.components.supportClasses.TrackBase
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     *
+     */
+    public class SparkTrackBaseAutomationImpl extends SparkRangeAutomationImpl
+    {
+
+        include "../../../../core/Version.as";
+        //--------------------------------------------------------------------------
+        //
+        //  Class methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  Registers the delegate class for a component class with automation manager.
+         *
+         *  @param root The SystemManger of the application.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public static function init(root:DisplayObject):void
+        {
+            Automation.registerDelegateClass(spark.components.supportClasses.TrackBase, SparkTrackBaseAutomationImpl);
+        }
+
+        /**
+         *  Constructor.
+         * @param obj TrackBase object to be automated.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 9
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function SparkTrackBaseAutomationImpl(obj:spark.components.supportClasses.TrackBase)
+        {
+            super(obj);
+
+        }
+
+
+    }
+
 }


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@1290445 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/advancedgrids/src/mx/controls/olapDataGridClasses/OLAPDataGridItemRendererProvider.as
+++ frameworks/projects/advancedgrids/src/mx/controls/olapDataGridClasses/OLAPDataGridItemRendererProvider.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controls.olapDataGridClasses
 {


Remove dead code. r=Armando

Remove dead code. r=Armando

git-svn-id: c197267f952b24206666de142881703007ca05d5@10675 b35dd754-fafc-0310-a699-88a17e54d16e

--- src/org/jivesoftware/xiff/core/XMPPConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPConnection.as
@@ -202,8 +202,6 @@
 		 */
 		protected var _expireTagSearch:Boolean;

-		protected static var _openConnections:Array = [];
-
 		public function XMPPConnection()
 		{

@@ -607,25 +605,12 @@

 		protected function set active(flag:Boolean):void
 		{
-			if(flag)
-			{
-				_openConnections.push(this);
-			}
-			else
-			{
-				_openConnections.splice(_openConnections.indexOf(this), 1);
-			}
 			_active = flag;
 		}

 		protected function get active():Boolean
 		{
 			return _active;
-		}
-
-		public static function get openConnections():Array
-		{
-			return _openConnections;
 		}

 		/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

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

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

--- frameworks/projects/framework/src/mx/collections/ISort.as
+++ frameworks/projects/framework/src/mx/collections/ISort.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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 mx.collections
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/framework/src/mx/core/IStateClient.as
+++ frameworks/projects/framework/src/mx/core/IStateClient.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2007 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/styles/StyleProxy.as
+++ frameworks/projects/framework/src/mx/styles/StyleProxy.as
@@ -0,0 +1,286 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+import mx.core.mx_internal;
+import mx.core.FlexVersion;
+
+use namespace mx_internal;
+
+/**
+ *  Wraps an object that implements the IStyleClient interface. This interface
+ *  supports a filterMap property that contains style-source/style-destination pairs.
+ *
+ *  @see mx.styles.IStyleClient
+ */
+public class StyleProxy implements IStyleClient
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param source The object that implements the IStyleClient interface.
+     *  @param filterMap The set of styles to pass from the source to the subcomponent.
+     */
+    public function StyleProxy(source:IStyleClient, filterMap:Object)
+    {
+        super();
+
+        this.filterMap = filterMap;
+        this.source = source;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  className
+    //----------------------------------
+
+    /**
+     *  @copy mx.styles.IStyleClient#className
+     */
+    public function get className():String
+    {
+        return _source.className;
+    }
+
+    //----------------------------------
+    //  filterMap
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the filterMap property.
+     */
+    private var _filterMap:Object;
+
+    /**
+     *  A set of string pairs. The first item of the string pair is the name of the style
+     *  in the source component. The second item of the String pair is the name of the style
+     *  in the subcomponent. With this object, you can map a particular style in the parent component
+     *  to a different style in the subcomponent. This is useful if both the parent
+     *  component and the subcomponent share the same style, but you want to be able to
+     *  control the values seperately.
+     */
+    public function get filterMap():Object
+    {
+        return FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
+               null :
+               _filterMap;
+    }
+
+    /**
+     *  @private
+     */
+    public function set filterMap(value:Object):void
+    {
+        _filterMap = value;
+    }
+
+    //----------------------------------
+    //  inheritingStyles
+    //----------------------------------
+
+    /**
+     *  @copy mx.styles.IStyleClient#inheritingStyles
+     */
+    public function get inheritingStyles():Object
+    {
+        return _source.inheritingStyles;
+    }
+
+    /**
+     *  @private
+     */
+    public function set inheritingStyles(value:Object):void
+    {
+        // This should never happen
+    }
+
+    //----------------------------------
+    //  nonInheritingStyles
+    //----------------------------------
+
+    /**
+     *  @copy mx.styles.IStyleClient#nonInheritingStyles
+     */
+    public function get nonInheritingStyles():Object
+    {
+        return FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
+               _source.nonInheritingStyles :
+               null; // This will always need to get reconstructed
+    }
+
+    /**
+     *  @private
+     */
+    public function set nonInheritingStyles(value:Object):void
+    {
+        // This should never happen
+    }
+
+    //----------------------------------
+    //  source
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the filterMap property.
+     */
+    private var _source:IStyleClient;
+
+    /**
+     *  The object that implements the IStyleClient interface. This is the object
+     *  that is being proxied.
+     */
+    public function get source():IStyleClient
+    {
+        return _source;
+    }
+
+    /**
+     *  @private
+     */
+    public function set source(value:IStyleClient):void
+    {
+        _source = value;
+    }
+
+    //----------------------------------
+    //  styleDeclaration
+    //----------------------------------
+
+    /**
+     *  @copy mx.styles.IStyleClient#styleDeclaration
+     */
+    public function get styleDeclaration():CSSStyleDeclaration
+    {
+        return _source.styleDeclaration;
+    }
+
+    /**
+     *  @private
+     */
+    public function set styleDeclaration(value:CSSStyleDeclaration):void
+    {
+        _source.styleDeclaration = styleDeclaration;
+    }
+
+    //----------------------------------
+    //  styleName
+    //----------------------------------
+
+    /**
+     *  @copy mx.styles.ISimpleStyleClient#styleName
+     */
+    public function get styleName():Object
+    {
+        if (_source.styleName is IStyleClient)
+            return new StyleProxy(IStyleClient(_source.styleName), filterMap);
+        else
+            return _source.styleName;
+    }
+
+    /**
+     *  @private
+     */
+    public function set styleName(value:Object):void
+    {
+        _source.styleName = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @copy mx.styles.ISimpleStyleClient#styleChanged()
+     */
+    public function styleChanged(styleProp:String):void
+    {
+        return _source.styleChanged(styleProp);
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#getStyle()
+     */
+    public function getStyle(styleProp:String):*
+    {
+        return _source.getStyle(styleProp);
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#setStyle()
+     */
+    public function setStyle(styleProp:String, newValue:*):void
+    {
+        _source.setStyle(styleProp, newValue);
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#clearStyle()
+     */
+    public function clearStyle(styleProp:String):void
+    {
+        _source.clearStyle(styleProp);
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#getClassStyleDeclarations()
+     */
+    public function getClassStyleDeclarations():Array
+    {
+        return _source.getClassStyleDeclarations();
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#notifyStyleChangeInChildren()
+     */
+    public function notifyStyleChangeInChildren(styleProp:String,
+                                                recursive:Boolean):void
+    {
+        return _source.notifyStyleChangeInChildren(styleProp, recursive);
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#regenerateStyleCache()
+     */
+    public function regenerateStyleCache(recursive:Boolean):void
+    {
+        _source.regenerateStyleCache(recursive);
+        return;
+    }
+
+    /**
+     *  @copy mx.styles.IStyleClient#registerEffects()
+     */
+    public function registerEffects(effects:Array):void
+    {
+        return _source.registerEffects(effects);
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 19344
Author:   egeorgie@adobe.com
Date:     2010-12-14T00:38:13.222484Z

Log Message:
-----------
PARB changes for density scaling

- authorDensity -> applicationDPI, type changed to int
- DensityUtil not visible in the documentation anymore [ExcludeClass]
- DensityUtil. screenDPIToDeviceDensity() -> classifyDPI(), returns int now
- DensityUtil. getDensityScale() -> getDPIScale(), takes int now
- DeviceDensity enum -> DPIClassification enum
- ISystemManager.densityScale property has been removed.
- New property to Application -> runtimeDPI.

QE notes: can start writing automated tests now
Doc notes:
Bugs:
Reviewer: Alex, Glenn, Jason SJ,
Tests run: checkintest
Is noteworthy for integration: Yes

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/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/utils/DensityUtil.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DeviceDensity.as" copyfrom-rev="19256" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DPIClassification.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/NavigationAngledButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionButtonSkin.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/DeviceDensity.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderDataTip.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/CheckBoxSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/preloaders/SplashScreen.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/RadioButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/NavigationButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Application.as</path>

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

--- frameworks/projects/framework/src/mx/utils/DensityUtil.as
+++ frameworks/projects/framework/src/mx/utils/DensityUtil.as
@@ -11,7 +11,9 @@

 package mx.utils
 {
-import mx.core.DeviceDensity;
+import mx.core.DPIClassification;
+
+[ExcludeClass]

 /**
  *  The DensityUtil class is an all-static class with methods for working with
@@ -20,89 +22,66 @@
  *  Flex uses this class to calculate the scaling factor when automatic density
  *  scaling is enabled for the Application.
  *
- *  @see mx.core.DeviceDensity
- *  @see spark.components.Appliction#authorDensity
- *  @see mx.core.ISystemManager#densityScale
+ *  @see mx.core.DPIClassification
+ *  @see spark.components.Application#applicationDPI
  */
 public class DensityUtil
 {
     /**
-     *  Matches the specified DPI to DeviceDensity value.
+     *  Matches the specified DPI to a DPIClassification value.
      *
-     *  Flex uses this method to calculate the current density value when an Application
-     *  authored for a specific density is adapted to the current one through scaling.
+     *  Flex uses this method to calculate the current dpi value when an Application
+     *  authored for a specific dpi is adapted to the current one through scaling.
      *
      *  A number of devices can have slightly different DPI values and Flex maps these
-     *  into the several density buckets.
+     *  into the several dpi buckets.
      *
      *  Flex uses the flash.system.Capabilities.screenDPI to calculate the
-     *  current device density.
+     *  current device dpi.
      *
      *  @param dpi The DPI value.
-     *  @return The corresponding DeviceDensity value.
+     *  @return The corresponding DPIClassification value.
      *
-     *  @see #getDensityScale
-     *  @see mx.core.DeviceDensity
-     *  @see spark.components.Appliction#authorDensity
-     *  @see mx.core.ISystemManager#densityScale
+     *  @see #getDPIScale
+     *  @see mx.core.DPIClassification
      */
-    public static function screenDPIToDeviceDensity(dpi:Number):String
+    public static function classifyDPI(dpi:Number):int
     {
         if (dpi < 200)
-            return DeviceDensity.PPI_160;
+            return DPIClassification.DPI_160;

         if (dpi <= 280)
-            return DeviceDensity.PPI_240;
+            return DPIClassification.DPI_240;

-        return DeviceDensity.PPI_320;
+        return DPIClassification.DPI_320;
     }

     /**
      *  Calculates a scale factor to be used when element authored for
-     *  sourceDensity is rendered at targetDensity.
+     *  sourceDPI is rendered at targetDPI.
      *
-     *  @param sourceDensity The DeviceDensity value for which a
+     *  @param sourceDPI The DPIClassification value for which a
      *  resource is optimized.
      *
-     *  @param targetDensity The DeviceDensity density value at
+     *  @param targetDPI The DPIClassification dpi value at
      *  which a resource is rendered.
      *
      *  @return The scale factor to be applied to the resource at render time.
      *
-     *  @see #screenDPIToDeviceDensity
-     *  @see mx.core.DeviceDensity
-     *  @see spark.components.Appliction#authorDensity
-     *  @see mx.core.ISystemManager#densityScale
+     *  @see #classifyDPI
+     *  @see mx.core.DPIClassification
      */
-    public static function getDensityScale(sourceDensity:String, targetDensity:String):Number
+    public static function getDPIScale(sourceDPI:int, targetDPI:int):Number
     {
-        // Unknown density returns NaN
-        if ((sourceDensity != DeviceDensity.PPI_160 && sourceDensity != DeviceDensity.PPI_240 && sourceDensity != DeviceDensity.PPI_320) ||
-            (targetDensity != DeviceDensity.PPI_160 && targetDensity != DeviceDensity.PPI_240 && targetDensity != DeviceDensity.PPI_320))
+        // Unknown dpi returns NaN
+        if ((sourceDPI != DPIClassification.DPI_160 && sourceDPI != DPIClassification.DPI_240 && sourceDPI != DPIClassification.DPI_320) ||
+            (targetDPI != DPIClassification.DPI_160 && targetDPI != DPIClassification.DPI_240 && targetDPI != DPIClassification.DPI_320))
         {
             return NaN;
         }

-        var density2Index:Function = function (density:String):int
-        {
-            return (density == DeviceDensity.PPI_160) ? 0 :
-                   (density == DeviceDensity.PPI_240) ? 1 : 2;
-        }
-
-        var sourceIndex:int = density2Index(sourceDensity);
-        var targetIndex:int = density2Index(targetDensity);
-
-        var scale:Number = scaleTable[ sourceIndex ][ targetIndex ];
-        return scale;
+        return Number(targetDPI) / Number(sourceDPI);
     }
-
-    /**
-     *  @private
-     *  Scale table for the getDensityScale() method
-     */
-    private static const scaleTable:Array = [[ 160 / 160 /* 160 -> 160 */, 240 / 160 /* 160 -> 240*/, 320 / 160 /* 160 -> 320*/],
-                                             [ 160 / 240 /* 240 -> 160 */, 240 / 240 /* 240 -> 240*/, 320 / 240 /* 240 -> 320*/],
-                                             [ 160 / 320 /* 320 -> 160 */, 240 / 320 /* 320 -> 240*/, 320 / 320 /* 320 -> 320*/]];
 }

 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/framework/src/mx/utils/ObjectProxy.as
+++ frameworks/projects/framework/src/mx/utils/ObjectProxy.as
@@ -0,0 +1,641 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2005-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.utils
+{
+
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.utils.getQualifiedClassName;
+import flash.utils.IDataInput;
+import flash.utils.IDataOutput;
+import flash.utils.IExternalizable;
+import flash.utils.Proxy;
+import flash.utils.flash_proxy;
+import mx.core.IPropertyChangeNotifier;
+import mx.events.PropertyChangeEvent;
+import mx.events.PropertyChangeEventKind;
+
+use namespace flash_proxy;
+use namespace object_proxy;
+
+[Bindable("propertyChange")]
+[RemoteClass(alias="flex.messaging.io.ObjectProxy")]
+
+/**
+ *  This class provides the ability to track changes to an item
+ *  managed by this proxy.
+ *  Any number of objects can "listen" for changes on this
+ *  object, by using the addEventListener() method.
+ *
+ *  @example
+ *

+ *  import mx.events.PropertyChangeEvent;
+ *  import mx.utils.ObjectUtil;
+ *  import mx.utils.ObjectProxy;
+ *  import mx.utils.StringUtil;
+ *
+ *  var a:Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" };
+ *  var p:ObjectProxy = new ObjectProxy(a);
+ *  p.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateHandler);
+ *  p.name = "Jacey";
+ *  p.age = 2;
+ *  delete p.ssnum;
+ *
+ *  // handler function
+ *  function updateHandler(event:ChangeEvent):void
+ *  {
+ *      trace(StringUtil.substitute("updateHandler('{0}', {1}, {2}, {3}, '{4}')",
+ *                                     event.kind,
+ *                                     event.property,
+ *                                     event.oldValue,
+ *                                     event.newValue,
+ *                                     event.target.object_proxy::UUID));
+ *  }
+ *
+ *  // The trace output appears as:
+ *  // updateHandler('opUpdate', name, Jacey, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ *  // updateHandler('opUpdate', age, 2, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ *  // updateHandler('opDelete', ssnum, null, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+ *

+ */
+public dynamic class ObjectProxy extends Proxy
+                                 implements IExternalizable,
+                                 IPropertyChangeNotifier
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Initializes this proxy with the specified object, id and proxy depth.
+     *
+     *  @param item Object to proxy.
+     *  If no item is specified, an anonymous object will be constructed
+     *  and assigned.
+     *
+     *  @param uid String containing the unique id
+     *  for this object instance.
+     *  Required for IPropertyChangeNotifier compliance as every object must
+     *  provide a unique way of identifying it.
+     *  If no value is specified, a random id will be assigned.
+     *
+     *  @param proxyDepth An integer indicating how many levels in a complex
+     *  object graph should have a proxy created during property access.
+     *  The default is -1, meaning "proxy to infinite depth".
+     *
+     *  @example
+     *
+     *

+     *  import mx.events.PropertyChangeEvent;
+     *  import mx.utils.ObjectUtil;
+     *  import mx.utils.ObjectProxy;
+     *  import mx.utils.StringUtil;
+     *
+     *  var a:Object = { name: "Tyler", age: 5, ssnum: "555-55-5555" };
+     *  var p:ObjectProxy = new ObjectProxy(a);
+     *  p.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, updateHandler);
+     *  p.name = "Jacey";
+     *  p.age = 2;
+     *  delete p.ssnum;
+     *
+     *  // handler function
+     *  function updateHandler(event:PropertyChangeEvent):void
+     *  {
+     *      trace(StringUtil.substitute("updateHandler('{0}', {1}, {2}, {3}, '{4}')",
+     *                                     event.kind,
+     *                                     event.property,
+     *                                     event.oldValue,
+     *                                     event.newValue,
+     *                                     event.target.uid));
+     *  }
+     *
+     *  // trace output
+     *  updateHandler('opUpdate', name, Jacey, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+     *  updateHandler('opUpdate', age, 2, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+     *  updateHandler('opDelete', ssnum, null, '698AF8CB-B3D9-21A3-1AFFDGHT89075CD2')
+     *

+     */
+    public function ObjectProxy(item:Object = null, uid:String = null,
+                                proxyDepth:int = -1)
+    {
+        super();
+
+        if (!item)
+            item = {};
+        _item = item;
+
+        _proxyLevel = proxyDepth;
+
+        notifiers = {};
+
+        dispatcher = new EventDispatcher(this);
+
+        // If we got an id, use it.  Otherwise the UID is lazily
+        // created in the getter for UID.
+        if (uid)
+            _id = uid;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  A reference to the EventDispatcher for this proxy.
+     */
+    protected var dispatcher:EventDispatcher;
+
+    /**
+     *  A hashmap of property change notifiers that this proxy is
+     *  listening for changes from; the key of the map is the property name.
+     */
+    protected var notifiers:Object;
+
+    /**
+     *  Indicates what kind of proxy to create
+     *  when proxying complex properties.
+     *  Subclasses should assign this value appropriately.
+     */
+    protected var proxyClass:Class = ObjectProxy;
+
+    /**
+     *  Contains a list of all of the property names for the proxied object.
+     *  Descendants need to fill this list by overriding the
+     *  setupPropertyList() method.
+     */
+    protected var propertyList:Array;
+
+    /**
+     *  Indicates how deep proxying should be performed.
+     *  If -1 (default), always proxy;
+     *  if this value is zero, no proxying will be performed.
+     */
+    private var _proxyLevel:int;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  object
+    //----------------------------------
+
+    /**
+     *  Storage for the object property.
+     */
+    private var _item:Object;
+
+    /**
+     *  The object being proxied.
+     */
+    object_proxy function get object():Object
+    {
+        return _item;
+    }
+
+    //----------------------------------
+    //  type
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the qualified type name.
+     */
+    private var _type:QName;
+
+    /**
+     *  The qualified type name associated with this object.
+     */
+    object_proxy function get type():QName
+    {
+        return _type;
+    }
+
+    /**
+     *  @private
+     */
+    object_proxy function set type(value:QName):void
+    {
+        _type = value;
+    }
+
+    //----------------------------------
+    //  uid
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the uid property.
+     */
+    private var _id:String;
+
+    /**
+     *  The unique identifier for this object.
+     */
+    public function get uid():String
+    {
+    	if (_id === null)
+            _id = UIDUtil.createUID();
+
+        return _id;
+    }
+
+    /**
+     *  @private
+     */
+    public function set uid(value:String):void
+    {
+        _id = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Returns the specified property value of the proxied object.
+     *
+     *  @param name Typically a string containing the name of the property,
+     *  or possibly a QName where the property name is found by
+     *  inspecting the localName property.
+     *
+     *  @return The value of the property.
+     *  In some instances this value may be an instance of
+     *  ObjectProxy.
+     */
+    override flash_proxy function getProperty(name:*):*
+    {
+        // if we have a data proxy for this then
+        var result:*;
+
+        if (notifiers[name.toString()])
+            return notifiers[name];
+
+        result = _item[name];
+
+        if (result)
+        {
+            if (_proxyLevel == 0 || ObjectUtil.isSimple(result))
+            {
+                return result;
+            }
+            else
+            {
+                result = object_proxy::getComplexProperty(name, result);
+            } // if we are proxying
+        }
+
+        return result;
+    }
+
+    /**
+     *  Returns the value of the proxied object's method with the specified name.
+     *
+     *  @param name The name of the method being invoked.
+     *
+     *  @param rest An array specifying the arguments to the
+     *  called method.
+     *
+     *  @return The return value of the called method.
+     */
+    override flash_proxy function callProperty(name:*, ... rest):*
+    {
+        return _item[name].apply(_item, rest)
+    }
+
+    /**
+     *  Deletes the specified property on the proxied object and
+     *  sends notification of the delete to the handler.
+     *
+     *  @param name Typically a string containing the name of the property,
+     *  or possibly a QName where the property name is found by
+     *  inspecting the localName property.
+     *
+     *  @return A Boolean indicating if the property was deleted.
+     */
+    override flash_proxy function deleteProperty(name:*):Boolean
+    {
+        var notifier:IPropertyChangeNotifier = IPropertyChangeNotifier(notifiers[name]);
+        if (notifier)
+        {
+            notifier.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+                                         propertyChangeHandler);
+            delete notifiers[name];
+        }
+
+        var oldVal:* = _item[name];
+        var deleted:Boolean = delete _item[name];
+
+        if (dispatcher.hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+        {
+            var event:PropertyChangeEvent = new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE);
+            event.kind = PropertyChangeEventKind.DELETE;
+            event.property = name;
+            event.oldValue = oldVal;
+            event.source = this;
+            dispatcher.dispatchEvent(event);
+        }
+
+        return deleted;
+    }
+
+    /**
+     *  This is an internal function that must be implemented by
+     *  a subclass of flash.utils.Proxy.
+     *
+     *  @param name The property name that should be tested
+     *  for existence.
+     *
+     *  @see flash.utils.Proxy#hasProperty()
+     */
+    override flash_proxy function hasProperty(name:*):Boolean
+    {
+        return(name in _item);
+    }
+
+    /**
+     *  This is an internal function that must be implemented by
+     *  a subclass of flash.utils.Proxy.
+     *
+     *  @see flash.utils.Proxy#nextName()
+     */
+    override flash_proxy function nextName(index:int):String
+    {
+        return propertyList[index -1];
+    }
+
+    /**
+     *  This is an internal function that must be implemented by
+     *  a subclass of flash.utils.Proxy.
+     *
+     *  @see flash.utils.Proxy#nextNameIndex()
+     */
+    override flash_proxy function nextNameIndex(index:int):int
+    {
+        if (index == 0)
+        {
+            setupPropertyList();
+        }
+
+        if (index < propertyList.length)
+        {
+            return index + 1;
+        }
+        else
+        {
+            return 0;
+        }
+    }
+
+    /**
+     *  This is an internal function that must be implemented by
+     *  a subclass of flash.utils.Proxy.
+     *
+     *  @see flash.utils.Proxy#nextValue()
+     */
+    override flash_proxy function nextValue(index:int):*
+    {
+        return _item[propertyList[index -1]];
+    }
+
+    /**
+     *  Updates the specified property on the proxied object
+     *  and sends notification of the update to the handler.
+     *
+     *  @param name Object containing the name of the property that
+     *  should be updated on the proxied object.
+     *
+     *  @param value Value that should be set on the proxied object.
+     */
+    override flash_proxy function setProperty(name:*, value:*):void
+    {
+        var oldVal:* = _item[name];
+        if (oldVal !== value)
+        {
+            // Update item.
+            _item[name] = value;
+
+            // Stop listening for events on old item if we currently are.
+            var notifier:IPropertyChangeNotifier =
+                IPropertyChangeNotifier(notifiers[name]);
+            if (notifier)
+            {
+                notifier.removeEventListener(
+                    PropertyChangeEvent.PROPERTY_CHANGE,
+                    propertyChangeHandler);
+                delete notifiers[name];
+            }
+
+            // Notify anyone interested.
+            if (dispatcher.hasEventListener(PropertyChangeEvent.PROPERTY_CHANGE))
+            {
+                if (name is QName)
+                    name = QName(name).localName;
+                var event:PropertyChangeEvent =
+                    PropertyChangeEvent.createUpdateEvent(
+                        this, name.toString(), oldVal, value);
+                dispatcher.dispatchEvent(event);
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  object_proxy methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Provides a place for subclasses to override how a complex property that
+     *  needs to be either proxied or daisy chained for event bubbling is managed.
+     *
+     *  @param name Typically a string containing the name of the property,
+     *  or possibly a QName where the property name is found by
+     *  inspecting the localName property.
+     *
+     *  @param value The property value.
+     *
+     *  @return The property value or an instance of ObjectProxy.
+     */
+    object_proxy function getComplexProperty(name:*, value:*):*
+    {
+        if (value is IPropertyChangeNotifier)
+        {
+            value.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+                                   propertyChangeHandler);
+            notifiers[name] = value;
+            return value;
+        }
+
+        if (getQualifiedClassName(value) == "Object")
+        {
+            value = new proxyClass(_item[name], null,
+                _proxyLevel > 0 ? _proxyLevel - 1 : _proxyLevel);
+            value.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE,
+                                   propertyChangeHandler);
+            notifiers[name] = value;
+            return value;
+        }
+
+        return value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  IExternalizable Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Since Flex only uses ObjectProxy to wrap anonymous objects,
+     *  the server flex.messaging.io.ObjectProxy instance serializes itself
+     *  as a Map that will be returned as a plain ActionScript object.
+     *  You can then set the object_proxy object property to this value.
+     */
+    public function readExternal(input:IDataInput):void
+    {
+        var value:Object = input.readObject();
+        _item = value;
+    }
+
+    /**
+     *  Since Flex only serializes the inner ActionScript object that it wraps,
+     *  the server flex.messaging.io.ObjectProxy populates itself
+     *  with this anonymous object's contents and appears to the user as a Map.
+     */
+    public function writeExternal(output:IDataOutput):void
+    {
+        output.writeObject(_item);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Registers an event listener object
+     *  so that the listener receives notification of an event.
+     *  For more information, see the flash.events.EventDispatcher class.
+     *
+     *  @see flash.events.EventDispatcher#addEventListener()
+     */
+    public function addEventListener(type:String, listener:Function,
+                                     useCapture:Boolean = false,
+                                     priority:int = 0,
+                                     useWeakReference:Boolean = false):void
+    {
+        dispatcher.addEventListener(type, listener, useCapture,
+                                    priority, useWeakReference);
+    }
+
+    /**
+     *  Removes an event listener.
+     *  If there is no matching listener registered with the EventDispatcher object,
+     *  a call to this method has no effect.
+     *  For more information, see the flash.events.EventDispatcher class.
+     *
+     *  @see flash.events.EventDispatcher#removeEventListener()
+     */
+    public function removeEventListener(type:String, listener:Function,
+                                        useCapture:Boolean = false):void
+    {
+        dispatcher.removeEventListener(type, listener, useCapture);
+    }
+
+    /**
+     *  Dispatches an event into the event flow.
+     *  For more information, see the flash.events.EventDispatcher class.
+     *
+     *  @see flash.events.EventDispatcher#dispatchEvent()
+     */
+    public function dispatchEvent(event:Event):Boolean
+    {
+        return dispatcher.dispatchEvent(event);
+    }
+
+    /**
+     *  Checks whether there are any event listeners registered
+     *  for a specific type of event.
+     *  This allows you to determine where an object has altered handling
+     *  of an event type in the event flow hierarchy.
+     *  For more information, see the flash.events.EventDispatcher class.
+     *
+     *  @see flash.events.EventDispatcher#hasEventListener()
+     */
+    public function hasEventListener(type:String):Boolean
+    {
+        return dispatcher.hasEventListener(type);
+    }
+
+    /**
+     *  Checks whether an event listener is registered with this object
+     *  or any of its ancestors for the specified event type.
+     *  This method returns true if an event listener is triggered
+     *  during any phase of the event flow when an event of the specified
+     *  type is dispatched to this object or any of its descendants.
+     *  For more information, see the flash.events.EventDispatcher class.
+     *
+     *  @see flash.events.EventDispatcher#willTrigger()
+     */
+    public function willTrigger(type:String):Boolean
+    {
+        return dispatcher.willTrigger(type);
+    }
+
+    /**
+     *  Called when a complex property is updated.
+     */
+    public function propertyChangeHandler(event:PropertyChangeEvent):void
+    {
+        dispatcher.dispatchEvent(event);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Protected Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  This method creates an array of all of the property names for the
+     *  proxied object.
+     *  Descendants must override this method if they wish to add more
+     *  properties to this list.
+     *  Be sure to call super.setupPropertyList before making any
+     *  changes to the propertyList property.
+     */
+    protected function setupPropertyList():void
+    {
+        if (getQualifiedClassName(_item) == "Object")
+        {
+            propertyList = [];
+            for (var prop:String in _item)
+                propertyList.push(prop);
+        }
+        else
+        {
+            propertyList = ObjectUtil.getClassInfo(_item, null, {includeReadOnly:true, uris:["*"]}).properties;
+        }
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 2905
Author:   clucier@adobe.com
Date:     2008-08-19T20:45:59.993275Z

Log Message:
-----------
Changes to allow UIComponent to take advantage of the new bindable filters (bindable wrappers around DropShadowFilter, GlowFilter, etc. that will force the filter stack to be re-evaluated when one or more of the filter parameters change). Checkin-tests: PASS
Reviewer: Jason
Bugs: SDK-16311
QA: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/Parser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/ConvolutionFilter.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BaseDimensionFilter.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BaseDimensionFilter.as" copyfrom-rev="2873" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseDimensionFilter.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/IBitmapFilter.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/IBitmapFilter.as" copyfrom-rev="2873" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/IBitmapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/GradientGlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/graphicsClasses/GraphicElement.as</path>
<path kind="dir" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/BitmapGraphic.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/GradientFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/ColorMatrixFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BlurFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/DisplacementMapFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/graphics/StrokedElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/GlowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BaseFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/DropShadowFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/FrameworkClasses.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/GradientBevelFilter.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/flex/filters/BaseFilter.as" copyfrom-rev="2873" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/filters/BaseFilter.as</path>

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

--- frameworks/projects/spark/src/spark/filters/BlurFilter.as
+++ frameworks/projects/spark/src/spark/filters/BlurFilter.as
@@ -3,6 +3,8 @@
 import flash.filters.BitmapFilter;
 import flash.filters.BitmapFilterQuality;
 import flash.filters.BlurFilter;
+import mx.filters.BaseFilter;
+import mx.filters.IBitmapFilter;

 public class BlurFilter extends BaseFilter implements IBitmapFilter
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 19238
Author:   klin@adobe.com
Date:     2010-12-09T21:51:35.152040Z

Log Message:
-----------
Add padding properties to TileLayout and TileGroup.

QE notes: Need to add tests for padding
Doc notes: No
Bugs: SDK-23159
Reviewer: Evtim
Tests run: cyclone server, checkintests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/layouts/TileLayout.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/TileGroup.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/TileLayout.as
+++ frameworks/projects/spark/src/spark/layouts/TileLayout.as
@@ -15,11 +15,10 @@
 import flash.geom.Rectangle;

 import mx.core.FlexVersion;
-import mx.core.IFlexModuleFactory;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
+import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
-import mx.core.UIComponentGlobals;
 import mx.events.PropertyChangeEvent;
 import mx.managers.ILayoutManagerClient;

@@ -453,7 +452,151 @@
         _rowHeight = value;
         invalidateTargetSizeAndDisplayList();
     }
-
+
+    //----------------------------------
+    //  paddingLeft
+    //----------------------------------
+
+    private var _paddingLeft:Number = 0;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  The minimum number of pixels between the container's left edge and
+     *  the left edge of the layout element.
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get paddingLeft():Number
+    {
+        return _paddingLeft;
+    }
+
+    /**
+     *  @private
+     */
+    public function set paddingLeft(value:Number):void
+    {
+        if (_paddingLeft == value)
+            return;
+
+        _paddingLeft = value;
+        invalidateTargetSizeAndDisplayList();
+    }
+
+    //----------------------------------
+    //  paddingRight
+    //----------------------------------
+
+    private var _paddingRight:Number = 0;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  The minimum number of pixels between the container's right edge and
+     *  the right edge of the layout element.
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get paddingRight():Number
+    {
+        return _paddingRight;
+    }
+
+    /**
+     *  @private
+     */
+    public function set paddingRight(value:Number):void
+    {
+        if (_paddingRight == value)
+            return;
+
+        _paddingRight = value;
+        invalidateTargetSizeAndDisplayList();
+    }
+
+    //----------------------------------
+    //  paddingTop
+    //----------------------------------
+
+    private var _paddingTop:Number = 0;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Number of pixels between the container's top edge
+     *  and the top edge of the first layout element.
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get paddingTop():Number
+    {
+        return _paddingTop;
+    }
+
+    /**
+     *  @private
+     */
+    public function set paddingTop(value:Number):void
+    {
+        if (_paddingTop == value)
+            return;
+
+        _paddingTop = value;
+        invalidateTargetSizeAndDisplayList();
+    }
+
+    //----------------------------------
+    //  paddingBottom
+    //----------------------------------
+
+    private var _paddingBottom:Number = 0;
+
+    [Inspectable(category="General")]
+
+    /**
+     *  Number of pixels between the container's bottom edge
+     *  and the bottom edge of the last layout element.
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get paddingBottom():Number
+    {
+        return _paddingBottom;
+    }
+
+    /**
+     *  @private
+     */
+    public function set paddingBottom(value:Number):void
+    {
+        if (_paddingBottom == value)
+            return;
+
+        _paddingBottom = value;
+        invalidateTargetSizeAndDisplayList();
+    }
+
     //----------------------------------
     //  horizontalAlign
     //----------------------------------
@@ -634,7 +777,7 @@
      *  the last fully visible row bottom edge aligns with the container's bottom edge.  Note that
      *  explicitly setting the rowHeight does not turn off justification, but
      *  determines the initial row height value.
-     *  Justification can then increases it.

+     *  Justification can then increase it.

      *
      *  @see #verticalGap
      *  @see #rowHeight
@@ -817,6 +960,8 @@
     /**
      *  This method is called from measure() and updateDisplayList() to calculate the
      *  actual values for columnWidth, rowHeight, columnCount, rowCount, horizontalGap and verticalGap.
+     *  The width and height should include padding because the padding is accounted for in
+     *  the calculations.
      *
      *  @param width - the width during measure() is the layout target explicitWidth or NaN
      *  and during updateDisplayList() is the unscaledWidth.
@@ -830,12 +975,15 @@
      */
     private function updateActualValues(width:Number, height:Number):void
     {
+        var widthMinusPadding:Number = width - paddingLeft - paddingRight;
+        var heightMinusPadding:Number = height - paddingTop - paddingBottom;
+
         // First, figure the tile size
         calculateTileSize();

         // Second, figure out number of rows/columns
         var elementCount:int = calculateElementCount();
-        calculateColumnAndRowCount(width, height, elementCount);
+        calculateColumnAndRowCount(widthMinusPadding, heightMinusPadding, elementCount);

         // Third, adjust the gaps and column and row sizes based on justification settings
         _horizontalGap = explicitHorizontalGap;
@@ -844,27 +992,27 @@
         // Justify
 		if (!isNaN(width))
 		{
-	        switch (columnAlign)
-	        {
-	            case ColumnAlign.JUSTIFY_USING_GAP:
-	                _horizontalGap = justifyByGapSize(width, _columnWidth, _horizontalGap, _columnCount);
-	            break;
-	            case ColumnAlign.JUSTIFY_USING_WIDTH:
-	                _columnWidth = justifyByElementSize(width, _columnWidth, _horizontalGap, _columnCount);
-	            break;
+            switch (columnAlign)
+            {
+                case ColumnAlign.JUSTIFY_USING_GAP:
+                    _horizontalGap = justifyByGapSize(widthMinusPadding, _columnWidth, _horizontalGap, _columnCount);
+                    break;
+                case ColumnAlign.JUSTIFY_USING_WIDTH:
+                    _columnWidth = justifyByElementSize(widthMinusPadding, _columnWidth, _horizontalGap, _columnCount);
+                    break;
 	        }
 		}

 		if (!isNaN(height))
 		{
-	        switch (rowAlign)
-	        {
-	            case RowAlign.JUSTIFY_USING_GAP:
-	                _verticalGap = justifyByGapSize(height, _rowHeight, _verticalGap, _rowCount);
-	            break;
-	            case RowAlign.JUSTIFY_USING_HEIGHT:
-	                _rowHeight = justifyByElementSize(height, _rowHeight, _verticalGap, _rowCount);
-	            break;
+            switch (rowAlign)
+            {
+                case RowAlign.JUSTIFY_USING_GAP:
+                    _verticalGap = justifyByGapSize(heightMinusPadding, _rowHeight, _verticalGap, _rowCount);
+                    break;
+                case RowAlign.JUSTIFY_USING_HEIGHT:
+                    _rowHeight = justifyByElementSize(heightMinusPadding, _rowHeight, _verticalGap, _rowCount);
+                    break;
 	        }
 		}

@@ -900,6 +1048,8 @@
      *  Calculates _columnCount and _rowCount based on width, height,
      *  orientation, _requestedColumnCount, _requestedRowCount, _columnWidth, _rowHeight.
      *  _columnWidth and _rowHeight must be valid before calling.
+     *
+     *  The width and height should not include padding.
      */
     private function calculateColumnAndRowCount(width:Number, height:Number, elementCount:int):void
     {
@@ -1229,15 +1379,15 @@

         var layoutTarget:GroupBase = target;
         var eltCount:int = layoutTarget.numElements;
-        visibleStartX = 0;   // initial values for xPos,yPos in updateDisplayList
-        visibleStartY = 0;
+        visibleStartX = paddingLeft;   // initial values for xPos,yPos in updateDisplayList
+        visibleStartY = paddingTop;
         visibleStartIndex = 0;
         visibleEndIndex = eltCount - 1;

         if (useVirtualLayout)
         {
-            var hsp:Number = layoutTarget.horizontalScrollPosition;
-            var vsp:Number = layoutTarget.verticalScrollPosition;
+            var hsp:Number = layoutTarget.horizontalScrollPosition - paddingLeft;
+            var vsp:Number = layoutTarget.verticalScrollPosition - paddingTop;
             var cwg:Number = _columnWidth + _horizontalGap;
             var rwg:Number = _rowHeight + _verticalGap;

@@ -1250,13 +1400,13 @@
             {
                 visibleStartIndex = (visibleRow0 * _columnCount);
                 visibleEndIndex = Math.min(eltCount - 1, (visibleRow1 * _columnCount) + visibleCol1);
-                visibleStartY = visibleRow0 * rwg;
+                visibleStartY = visibleRow0 * rwg + paddingTop;
             }
             else
             {
                 visibleStartIndex = (visibleCol0 * _rowCount);
                 visibleEndIndex = Math.min(eltCount - 1, (visibleCol1 * _rowCount) + visibleRow1);
-                visibleStartX = visibleCol0 * cwg;
+                visibleStartX = visibleCol0 * cwg + paddingLeft;
             }
         }
     }
@@ -1266,7 +1416,7 @@
      *  This method is called by updateDisplayList() after initial values for
      *  visibleStartIndex, visibleEndIndex have been calculated.  We
      *  re-calculateDisplayParameters() to account for the possibility that
-     *  larger cells may have been exposed.  Since tileWdth,Height can only
+     *  larger cells may have been exposed.  Since tileWidth,Height can only
      *  increase, the new visibleStart,EndIndex values will be greater than or
      *  equal to the old ones.
      */
@@ -1382,7 +1532,10 @@
      */
     final private function leftEdge(columnIndex:int):Number
     {
-        return Math.max(0, columnIndex * (_columnWidth + _horizontalGap));
+        if (columnIndex < 0)
+            return 0;
+
+        return Math.max(0, columnIndex * (_columnWidth + _horizontalGap)) + paddingLeft;
     }

     /**
@@ -1391,7 +1544,10 @@
      */
     final private function rightEdge(columnIndex:int):Number
     {
-        return Math.min(target.contentWidth, columnIndex * (_columnWidth + _horizontalGap) + _columnWidth);
+        if (columnIndex < 0)
+            return 0;
+
+        return Math.min(target.contentWidth, columnIndex * (_columnWidth + _horizontalGap) + _columnWidth) + paddingLeft;
     }

     /**
@@ -1400,7 +1556,10 @@
      */
     final private function topEdge(rowIndex:int):Number
     {
-        return Math.max(0, rowIndex * (_rowHeight + _verticalGap));
+        if (rowIndex < 0)
+            return 0;
+
+        return Math.max(0, rowIndex * (_rowHeight + _verticalGap)) + paddingTop;
     }

     /**
@@ -1409,7 +1568,10 @@
      */
     final private function bottomEdge(rowIndex:int):Number
     {
-        return Math.min(target.contentHeight, rowIndex * (_rowHeight + _verticalGap) + _rowHeight);
+        if (rowIndex < 0)
+            return 0;
+
+        return Math.min(target.contentHeight, rowIndex * (_rowHeight + _verticalGap) + _rowHeight) + paddingTop;
     }

     /**
@@ -1547,33 +1709,42 @@
             return;

         var cw:Number = !isNaN(layoutTarget.explicitWidth) ? layoutTarget.explicitWidth :
-                                                                layoutTarget.estimatedWidth;
+                                                             layoutTarget.estimatedWidth;
         var ch:Number = !isNaN(layoutTarget.explicitHeight) ? layoutTarget.explicitHeight :
-            layoutTarget.estimatedHeight;
+                                                              layoutTarget.estimatedHeight;
         updateActualValues(cw, ch);

         // For measure, any explicit overrides for rowCount and columnCount take precedence
         var columnCount:int = _requestedColumnCount != -1 ? Math.max(1, _requestedColumnCount) : _columnCount;
         var rowCount:int = _requestedRowCount != -1 ? Math.max(1, _requestedRowCount) : _rowCount;
-
-        if (columnCount == 0)
-            layoutTarget.measuredWidth = layoutTarget.measuredMinWidth = 0;
-        else
-        {
-            layoutTarget.measuredWidth = Math.ceil(columnCount * (_columnWidth + _horizontalGap) - _horizontalGap);
+
+        var measuredWidth:Number = 0;
+        var measuredMinWidth:Number = 0;
+        var measuredHeight:Number = 0;
+        var measuredMinHeight:Number = 0;
+
+        if (columnCount > 0)
+        {
+            measuredWidth = Math.ceil(columnCount * (_columnWidth + _horizontalGap) - _horizontalGap)
             // measured min size is guaranteed to have enough columns to fit all elements
-            layoutTarget.measuredMinWidth = Math.ceil(_columnCount * (_columnWidth + _horizontalGap) - _horizontalGap);
+            measuredMinWidth = Math.ceil(_columnCount * (_columnWidth + _horizontalGap) - _horizontalGap);
         }

-        if (rowCount == 0)
-            layoutTarget.measuredHeight = layoutTarget.measuredMinHeight = 0;
-        else
-        {
-            layoutTarget.measuredHeight = Math.ceil(rowCount * (_rowHeight + _verticalGap) - _verticalGap);
+        if (rowCount > 0)
+        {
+            measuredHeight = Math.ceil(rowCount * (_rowHeight + _verticalGap) - _verticalGap);
             // measured min size is guaranteed to have enough rows to fit all elements
-            layoutTarget.measuredMinHeight = Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap);
+            measuredMinHeight = Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap);
         }
 		_numElementsCached = -1;
+
+        var hPadding:Number = paddingLeft + paddingRight;
+        var vPadding:Number = paddingTop + paddingBottom;
+
+        layoutTarget.measuredWidth = measuredWidth + hPadding;
+        layoutTarget.measuredMinWidth = measuredMinWidth + hPadding;
+        layoutTarget.measuredHeight = measuredHeight + vPadding;
+        layoutTarget.measuredMinHeight = measuredMinHeight + vPadding;
     }

     /**
@@ -1820,8 +1991,8 @@
             updateVirtualLayout(unscaledWidth, unscaledHeight);  // re-calculateDisplayParameters()

         // Upper right hand corner of first (visibleStartIndex) tile/cell
-        var xPos:Number = visibleStartX;  // 0 if useVirtualLayout=false
-        var yPos:Number = visibleStartY;  // ...
+        var xPos:Number = visibleStartX;  // paddingLeft if useVirtualLayout=false
+        var yPos:Number = visibleStartY;  // paddingTop if useVirtualLayout=false

         // Use MajorDelta when moving along the major axis
         var xMajorDelta:Number;
@@ -1890,21 +2061,24 @@
                 counter = 0;
                 if (orientation == TileOrientation.ROWS)
                 {
-                    xPos = 0;
+                    xPos = paddingLeft;
                     yPos += yMinorDelta;
                 }
                 else
                 {
                     xPos += xMinorDelta;
-                    yPos = 0;
+                    yPos = paddingTop;
                 }
             }
         }

+        var hPadding:Number = paddingLeft + paddingRight;
+        var vPadding:Number = paddingTop + paddingBottom;
+
         // Make sure that if the content spans partially over a pixel to the right/bottom,
         // the content size includes the whole pixel.
-        layoutTarget.setContentSize(Math.ceil(_columnCount * (_columnWidth + _horizontalGap) - _horizontalGap),
-                                    Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap));
+        layoutTarget.setContentSize(Math.ceil(_columnCount * (_columnWidth + _horizontalGap) - _horizontalGap) + hPadding,
+                                    Math.ceil(_rowCount * (_rowHeight + _verticalGap) - _verticalGap) + vPadding);

         // Reset the cache
         if (!useVirtualLayout)
@@ -1954,7 +2128,7 @@
     {
         var bounds:Rectangle = new Rectangle();
         // Find the column that spans or is to the left of the scrollRect left edge.
-        var column:int = Math.floor((scrollRect.left - 1) / (_columnWidth + _horizontalGap));
+        var column:int = Math.floor((scrollRect.left - 1 - paddingLeft) / (_columnWidth + _horizontalGap));
         bounds.left = leftEdge(column);
         bounds.right = rightEdge(column);
         return bounds;
@@ -1967,7 +2141,7 @@
     {
         var bounds:Rectangle = new Rectangle();
         // Find the column that spans or is to the right of the scrollRect right edge.
-        var column:int = Math.floor((scrollRect.right + 1 + _horizontalGap) / (_columnWidth + _horizontalGap));
+        var column:int = Math.floor(((scrollRect.right + 1 + _horizontalGap) - paddingLeft) / (_columnWidth + _horizontalGap));
         bounds.left = leftEdge(column);
         bounds.right = rightEdge(column);
         return bounds;
@@ -1980,7 +2154,7 @@
     {
         var bounds:Rectangle = new Rectangle();
         // Find the row that spans or is above the scrollRect top edge
-        var row:int = Math.floor((scrollRect.top - 1) / (_rowHeight + _verticalGap));
+        var row:int = Math.floor((scrollRect.top - 1 - paddingTop) / (_rowHeight + _verticalGap));
         bounds.top = topEdge(row);
         bounds.bottom = bottomEdge(row);
         return bounds;
@@ -1993,7 +2167,7 @@
     {
         var bounds:Rectangle = new Rectangle();
         // Find the row that spans or is below the scrollRect bottom edge
-        var row:int = Math.floor((scrollRect.bottom + 1 + _verticalGap) / (_rowHeight + _verticalGap));
+        var row:int = Math.floor(((scrollRect.bottom + 1 + _verticalGap) - paddingTop) / (_rowHeight + _verticalGap));
         bounds.top = topEdge(row);
         bounds.bottom = bottomEdge(row);
         return bounds;
@@ -2023,15 +2197,17 @@

     /**
      *  @private
-     *  Calculates the column and row and returns the corrsponding cell index.
+     *  Calculates the column and row and returns the corresponding cell index.
      *  Index may be out of range if there's no element for the cell.
      */
     private function calculateDropCellIndex(x:Number, y:Number):Array
     {
-        var column:int = Math.floor(x / (_columnWidth + _horizontalGap));
-        var row:int = Math.floor(y / (_rowHeight + _verticalGap));
-
-        // Check whehter x is closer to left column or right column:
+        var xStart:Number = x - paddingLeft;
+        var yStart:Number = y - paddingTop;
+        var column:int = Math.floor(xStart / (_columnWidth + _horizontalGap));
+        var row:int = Math.floor(yStart / (_rowHeight + _verticalGap));
+
+        // Check whether x is closer to left column or right column:
         var midColumnLine:Number;
         var midRowLine:Number

@@ -2053,9 +2229,9 @@
             midRowLine = (row + 1) * (_rowHeight + _verticalGap) - _verticalGap - _rowHeight / 2;
         }

-        if (x > midColumnLine)
+        if (xStart > midColumnLine)
             column++;
-        if (y > midRowLine)
+        if (yStart > midRowLine)
             row++;

         // Limit row and column, if any one is too far from the drop location
@@ -2181,11 +2357,11 @@
                                           dropIndicatorElement.getMinBoundsWidth(false));
             }

-            x = emptySpaceLeft + Math.round((emptySpace - width) / 2);
+            x = emptySpaceLeft + Math.round((emptySpace - width) / 2) + paddingLeft;
             // Allow 1 pixel overlap with container border
             x = Math.max(-1, Math.min(target.contentWidth - width + 1, x));

-            y = row * (_rowHeight + _verticalGap);
+            y = row * (_rowHeight + _verticalGap) + paddingTop;
         }
         else
         {
@@ -2212,9 +2388,9 @@
                                            dropIndicatorElement.getMinBoundsWidth(false));
             }

-            x = column * (_columnWidth + _horizontalGap);
+            x = column * (_columnWidth + _horizontalGap) + paddingLeft;

-            y = emptySpaceTop + Math.round((emptySpace - height) / 2);
+            y = emptySpaceTop + Math.round((emptySpace - height) / 2) + paddingTop;
             // Allow 1 pixel overlap with container border
             y = Math.max(-1, Math.min(target.contentHeight - height + 1, y));
         }