remove unused file

remove unused file

--- src/com/mangui/HLS/utils/Bytes.as
+++ src/com/mangui/HLS/utils/Bytes.as
@@ -1,56 +0,0 @@
-package com.mangui.HLS.utils {
-
-
-    import flash.utils.ByteArray;
-
-
-    /** Class that groups some byte manipulation tools. **/
-    public class Bytes {
-
-
-        private static var BITS:Array = [
-            '0000','0001','0010','0011',
-            '0100','0101','0110','0111',
-            '1000','1001','1010','1011',
-            '1100','1101','1110','1111'
-        ];
-        private static var HEXES:Array = [
-            '0','1','2','3','4','5','6','7',
-            '8','9','A','B','C','D','E','F'
-        ];
-
-
-        /** Convert a binary string to a number. **/
-        public static function toNumber(string:String,binary:Boolean=true):Number {
-            var value:Number = 0;
-            for (var i:Number = 1; i <= string.length; i++) {
-                value += Number(string.charAt(string.length-i)) * Math.pow(2,i-1);
-            }
-            return value;
-        };
-
-
-        /** Return a print of a certain data range, in hex or binary. **/
-        public static function toString(data:ByteArray,length:Number=-1,binary:Boolean=true):String {
-            var start:Number = data.position;
-            var index:Number = start;
-            var string:String = '';
-            if(length == -1 ) { length = data.length - start; }
-            while(index < start + length) {
-                var byte:uint = data.readByte();
-                if(binary) {
-                    string += BITS[(byte & 0xF0) >> 4] + BITS[byte & 0x0F];
-                } else {
-                    string += HEXES[(byte & 0xF0) >> 4] + HEXES[byte & 0x0F];
-                }
-                index++;
-            }
-            data.position = start;
-            return string;
-        };
-
-
-    };
-
-
-}


Corrected ARSONFilter.

Corrected ARSONFilter.

--- src/flails/request/ARSONFilter.as
+++ src/flails/request/ARSONFilter.as
@@ -9,13 +9,8 @@
   import flails.request.Filter;

   public class ARSONFilter extends JSONFilter {
-    private var targetClass:Class;
     public function JSONFilter(targetClass:Class = null) {
-      if (targetClass) {
-        this.targetClass = targetClass;
-      } else {
-        this.targetClass = Record;
-      }
+      super(targetClass);
     }

     public function load(data:String):Object {
@@ -33,5 +28,9 @@
         return new targetClass(decoded);
       }
     }
+
+    public function dump(data:Object):Object {
+      return null;
+    }
   }
 }


make widevine plugin a dynamic class: this way we can access properties dynamically via kdp.evaluate

--- plugins/wvPlugin/src/wvPluginCode.as
+++ plugins/wvPlugin/src/wvPluginCode.as
@@ -1,83 +1,83 @@
-package
-{
-	import com.kaltura.kdpfl.model.ConfigProxy;
-	import com.kaltura.kdpfl.model.LayoutProxy;
-	import com.kaltura.kdpfl.model.MediaProxy;
-	import com.kaltura.kdpfl.plugin.IPlugin;
-	import com.kaltura.kdpfl.plugin.KPluginEvent;
-	import com.kaltura.kdpfl.plugin.WVPluginInfo;
-
-	import flash.display.Sprite;
-
-	import org.osmf.events.MediaFactoryEvent;
-	import org.osmf.media.DefaultMediaFactory;
-	import org.osmf.media.PluginInfoResource;
-	import org.puremvc.as3.interfaces.IFacade;
-
-	public class wvPluginCode extends Sprite implements IPlugin
-	{
-		protected var _flashvars : Object;
-
-		protected var _localMediaFactory : DefaultMediaFactory;
-		public function wvPluginCode()
-		{
-			trace('Widevine plugin v2');
-			super();
-		}
-		public function initializePlugin(facade:IFacade):void
-		{
-			_flashvars = (facade.retrieveProxy(ConfigProxy.NAME) as ConfigProxy).vo.flashvars;
-
-			_localMediaFactory = (facade.retrieveProxy(MediaProxy.NAME) as MediaProxy).vo.mediaFactory;
-			var wvpinfo: WVPluginInfo = new WVPluginInfo();
-
-			var lp:LayoutProxy = (facade.retrieveProxy(LayoutProxy.NAME) as LayoutProxy);
-			for each( var i:Object in lp.components)
-			{
-				if(i.hasOwnProperty("className") && i.className == "KMediaPlayer" )
-				{
-					trace(i.ui.width,i.ui.height );
-					WVPluginInfo.mediaWidth = i.ui.width;
-					WVPluginInfo.mediaHeight = i.ui.height;
-					break;
-				}
-			}
-
-
-			//overriding media width/height if flashvar available
-/*			if (_flashvars.widevinemediawidth)
-				WVPluginInfo.mediaWidth = Number(_flashvars.widevinemediawidth);
-			if (_flashvars.widevinemediaheight)
-				WVPluginInfo.mediaHeight = Number(_flashvars.widevinemediaheight);*/
-
-			_localMediaFactory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD, onOSMFPluginLoaded);
-			_localMediaFactory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD_ERROR, onOSMFPluginLoadError);
-
-
-			_localMediaFactory.loadPlugin(new PluginInfoResource(wvpinfo) );
-			var wvm:WvMediator = new WvMediator(wvpinfo);
-			facade.registerMediator(wvm);
-		}
-		/**
-		 * Listener for the LOAD_COMPLETE event.
-		 * @param e - MediaFactoryEvent
-		 *
-		 */
-		protected function onOSMFPluginLoaded (e : MediaFactoryEvent) : void
-		{
-			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_COMPLETE) );
-		}
-		/**
-		 * Listener for the LOAD_ERROR event.
-		 * @param e - MediaFactoryEvent
-		 *
-		 */
-		protected function onOSMFPluginLoadError (e : MediaFactoryEvent) : void
-		{
-			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_FAILED) );
-		}
-		public function setSkin(styleName:String, setSkinSize:Boolean=false):void
-		{
-		}
-	}
+package
+{
+	import com.kaltura.kdpfl.model.ConfigProxy;
+	import com.kaltura.kdpfl.model.LayoutProxy;
+	import com.kaltura.kdpfl.model.MediaProxy;
+	import com.kaltura.kdpfl.plugin.IPlugin;
+	import com.kaltura.kdpfl.plugin.KPluginEvent;
+	import com.kaltura.kdpfl.plugin.WVPluginInfo;
+
+	import flash.display.Sprite;
+
+	import org.osmf.events.MediaFactoryEvent;
+	import org.osmf.media.DefaultMediaFactory;
+	import org.osmf.media.PluginInfoResource;
+	import org.puremvc.as3.interfaces.IFacade;
+
+	public dynamic class wvPluginCode extends Sprite implements IPlugin
+	{
+		protected var _flashvars : Object;
+
+		protected var _localMediaFactory : DefaultMediaFactory;
+		public function wvPluginCode()
+		{
+			trace('Widevine plugin v2');
+			super();
+		}
+		public function initializePlugin(facade:IFacade):void
+		{
+			_flashvars = (facade.retrieveProxy(ConfigProxy.NAME) as ConfigProxy).vo.flashvars;
+
+			_localMediaFactory = (facade.retrieveProxy(MediaProxy.NAME) as MediaProxy).vo.mediaFactory;
+			var wvpinfo: WVPluginInfo = new WVPluginInfo();
+
+			var lp:LayoutProxy = (facade.retrieveProxy(LayoutProxy.NAME) as LayoutProxy);
+			for each( var i:Object in lp.components)
+			{
+				if(i.hasOwnProperty("className") && i.className == "KMediaPlayer" )
+				{
+					trace(i.ui.width,i.ui.height );
+					WVPluginInfo.mediaWidth = i.ui.width;
+					WVPluginInfo.mediaHeight = i.ui.height;
+					break;
+				}
+			}
+
+
+			//overriding media width/height if flashvar available
+/*			if (_flashvars.widevinemediawidth)
+				WVPluginInfo.mediaWidth = Number(_flashvars.widevinemediawidth);
+			if (_flashvars.widevinemediaheight)
+				WVPluginInfo.mediaHeight = Number(_flashvars.widevinemediaheight);*/
+
+			_localMediaFactory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD, onOSMFPluginLoaded);
+			_localMediaFactory.addEventListener(MediaFactoryEvent.PLUGIN_LOAD_ERROR, onOSMFPluginLoadError);
+
+
+			_localMediaFactory.loadPlugin(new PluginInfoResource(wvpinfo) );
+			var wvm:WvMediator = new WvMediator(wvpinfo);
+			facade.registerMediator(wvm);
+		}
+		/**
+		 * Listener for the LOAD_COMPLETE event.
+		 * @param e - MediaFactoryEvent
+		 *
+		 */
+		protected function onOSMFPluginLoaded (e : MediaFactoryEvent) : void
+		{
+			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_COMPLETE) );
+		}
+		/**
+		 * Listener for the LOAD_ERROR event.
+		 * @param e - MediaFactoryEvent
+		 *
+		 */
+		protected function onOSMFPluginLoadError (e : MediaFactoryEvent) : void
+		{
+			dispatchEvent( new KPluginEvent (KPluginEvent.KPLUGIN_INIT_FAILED) );
+		}
+		public function setSkin(styleName:String, setSkinSize:Boolean=false):void
+		{
+		}
+	}
 }


Mat Schaffer's patch fixes a duplicate variable definition warning in List control

--- src/org/openPyro/controls/List.as
+++ src/org/openPyro/controls/List.as
@@ -181,7 +181,9 @@
 		{
 			var childNodesData:Array = event.delta;
 			var renderer:DisplayObject
+			var newRenderer:DisplayObject
 			var eventSourceData:Object = event.eventNode;
+			var listData:Object
 			var parentNode:DisplayObject

 			var tgtY:Number;
@@ -190,8 +192,8 @@
 				tgtY = 0;
 				for(var l:int=childNodesData.length-1; l>=0; l--){
 					//(this.renderers.length == 0)?0:this.renderers[this.renderers.length-1].y
-					var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
-					var listData:Object = childNodesData[l]
+					newRenderer = _rendererPool.getObject() as DisplayObject;
+					listData = childNodesData[l]
 					setRendererData(newRenderer, listData, l);
 					this.contentPane.addChild(newRenderer);

@@ -212,8 +214,8 @@
 					parentNode = r;
 					var positionRefNode:DisplayObject = parentNode;
 					for(var k:int=childNodesData.length-1; k>=0; k--){
-						var newRenderer:DisplayObject = _rendererPool.getObject() as DisplayObject;
-						var listData:Object = childNodesData[k]
+						newRenderer = _rendererPool.getObject() as DisplayObject;
+						listData = childNodesData[k]
 						setRendererData(newRenderer, listData, k);
 						this.contentPane.addChildAt(newRenderer,0);
 						newRenderer.y = positionRefNode.y - newRenderer.height;


TSDemuxer:systematically reparse PMT to discover new PIDs ASAP

related to https://github.com/mangui/flashls/issues/502

--- src/org/mangui/hls/demux/TSDemuxer.as
+++ src/org/mangui/hls/demux/TSDemuxer.as
@@ -221,67 +221,67 @@
 		private function readCC(pes : PES):void
 		{
 			var country_code : uint = pes.data.readUnsignedByte();
-
+
 			if (country_code == 181)
 			{
 				var provider_code : uint = pes.data.readUnsignedShort();
-
+
 				if (provider_code == 49)
 				{
 					var user_structure : uint = pes.data.readUnsignedInt();
-
+
 					if (user_structure == 0x47413934) // GA94
 					{
 						var user_data_type : uint = pes.data.readUnsignedByte();
-
+
 						// CEA-608 wrapped in 708 ( user_data_type == 4 is raw 608, not handled yet )
 						if (user_data_type == 3)
 						{
 							// cc -- the first 8 bits are 1-Boolean-0 and the 5 bits for the number of CCs
 							var byte:uint = pes.data.readUnsignedByte();
-
+
 							// get the total number of cc_datas
 							var total:uint = 31 & byte;
 							var count:uint = 0;
-
+
 							// supposedly a flag to process the cc_datas or not
 							// isn't working for me, so i don't use it yet
 							var process:Boolean = !((64 & byte) == 0);
-
+
 							var size:uint = total * 3;
-
+
 							// em_data, do we need? It's not used for anything, but it's there, so i need to pull it out
 							var otherByte:uint = pes.data.readUnsignedByte();
-
+
 							if (pes.data.bytesAvailable >= size)
 							{
 								// ByteArray for onCaptionInfo event
 								var sei : ByteArray = new ByteArray();
-
+
 								// onCaptionInfo payloads need to know the size of the binary data
 								// there's two two bytes we just read, plus the cc_datas, which are 3 bytes each
 								sei.writeUnsignedInt(2+3*total);
-
+
 								// write those two bytes
 								sei.writeByte(byte);
 								sei.writeByte(otherByte);
-
+
 								// write the cc_datas
 								pes.data.readBytes(sei, 6, 3*total);
-
+
 								pes.data.position -= total * 3;
-
+
 								// onCaptionInfo expects Base64 data...
 								var sei_data:String = Base64.encode(sei);
-
+
 								var cc_data:Object = {
 									type: "708",
 									data: sei_data
 								};
-
+
 								// add a new FLVTag with the onCaptionInfo call
 								var tag:FLVTag = new FLVTag(FLVTag.METADATA, pes.pts, pes.pts, false);
-
+
 								var data : ByteArray = new ByteArray();
 								data.objectEncoding = ObjectEncoding.AMF0;
 								data.writeObject("onCaptionInfo");
@@ -303,7 +303,7 @@
 				}
 			}
 		}
-
+
         /** Parse a limited amount of packets each time to avoid blocking **/
         private function _parseTimer(e : Event) : void {
             var start_time : int = getTimer();
@@ -612,16 +612,16 @@
                     pes.data.readBytes(pps, 0, frame.length);
                     ppsvect.push(pps);
                 } else if (frame.type == 6) {
-
+
 					//unescape Emulation Prevention bytes
 					Nalu.unescapeStream(pes.data,frame.start,frame.start + frame.length);
-
+
 					// We already know it's 6, so skip first byte
 					pes.data.position = frame.start + 1;
-
+
 					// we need at least 12 bytes to retrieve Caption length
 					if(pes.data.bytesAvailable > 12) {
-
+
 						// get the SEI payload type
 						var payload_type : uint = 0;
 						var payload_size : uint = 0;
@@ -634,7 +634,7 @@
 							// Parse payload size.
 							payload_size = 0;
 							do {
-								payload_size += pes.data.readUnsignedByte();
+								payload_size += pes.data.readUnsignedByte();
 							} while (pes.data.bytesAvailable!=0 && payload_size == 0xFF);
 							// Process the payload. We only support EIA-608 payloads currently.
 							if (payload_type == 4) {
@@ -844,21 +844,22 @@
                                 Log.warn("TS: reparsing PMT, unknown PID found");
                             }
                         }
-                        todo -= _parsePMT(stt,data);
-                        // if PMT was not parsed before, and some unknown packets have been skipped in between,
-                        // rewind to beginning of the stream, it helps recovering bad segmented content
-                        // in theory there should be no A/V packets before PAT/PMT)
-                        if (_pmtParsed == false && _unknownPIDFound == true) {
-                            CONFIG::LOGGING {
-                                Log.warn("TS: late PMT found, rewinding at beginning of TS");
-                            }
-                            _pmtParsed = true;
-                            _readPosition = 0;
-                            return;
+                    }
+                    // always reparse PMT
+                    todo -= _parsePMT(stt,data);
+                    // if PMT was not parsed before, and some unknown packets have been skipped in between,
+                    // rewind to beginning of the stream, it helps recovering bad segmented content
+                    // in theory there should be no A/V packets before PAT/PMT)
+                    if (_pmtParsed == false && _unknownPIDFound == true) {
+                        CONFIG::LOGGING {
+                            Log.warn("TS: late PMT found, rewinding at beginning of TS");
                         }
                         _pmtParsed = true;
-                        _unknownPIDFound = false;
-                    }
+                        _readPosition = 0;
+                        return;
+                    }
+                    _pmtParsed = true;
+                    _unknownPIDFound = false;
                     break;
                 case _audioId:
                     if (_pmtParsed == false) {
@@ -1012,9 +1013,11 @@
                 } else if (typ == 0x1B) {
                     // ITU-T Rec. H.264 and ISO/IEC 14496-10 (lower bit-rate video)
                     if(_audioOnly == false) {
-                        _avcId = sid;
-                        CONFIG::LOGGING {
-                            Log.debug("TS: Selected video PID: " + _avcId);
+                        if(_avcId != sid) {
+                            _avcId = sid;
+                            CONFIG::LOGGING {
+                                Log.debug("TS: Selected video PID: " + _avcId);
+                            }
                         }
                     } else {
                         CONFIG::LOGGING {
@@ -1027,9 +1030,11 @@
                     audioList.push(new AudioTrack('TS/MP3 ' + audioList.length, AudioTrack.FROM_DEMUX, sid, (audioList.length == 0), false));
                 } else if (typ == 0x15) {
                     // ID3 pid
-                    _id3Id = sid;
-                    CONFIG::LOGGING {
-                        Log.debug("TS: Selected ID3 PID: " + _id3Id);
+                    if(_id3Id != sid) {
+                        _id3Id = sid;
+                        CONFIG::LOGGING {
+                            Log.debug("TS: Selected ID3 PID: " + _id3Id);
+                        }
                     }
                 }
                 // es_info_length
@@ -1039,34 +1044,37 @@
                 read += sel + 5;
             }

-            CONFIG::LOGGING {
-                if (audioList.length) {
-                    Log.debug("TS: Found " + audioList.length + " audio tracks");
-                }
-            }
             // provide audio track List to audio select callback. this callback will return the selected audio track
             var audioPID : int;
-            _audioFound = (audioList.length > 0);
-            var audioTrack : AudioTrack = _callback_audioselect(audioList);
-            if (audioTrack) {
-                audioPID = audioTrack.id;
-                _audioIsAAC = audioTrack.isAAC;
-                _audioSelected = true;
-                CONFIG::LOGGING {
-                    Log.debug("TS: selected " + (_audioIsAAC ? "AAC" : "MP3") + " PID: " + audioPID);
-                }
-            } else {
-                audioPID = -1;
-                _audioSelected = false;
-                CONFIG::LOGGING {
-                    Log.debug("TS: no audio selected");
-                }
-            }
-            // in case audio PID change, flush any partially parsed audio PES packet
-            if (audioPID != _audioId) {
-                _curAudioPES = null;
-                _adtsFrameOverflow = null;
-                _audioId = audioPID;
+            var audioFound : Boolean = (audioList.length > 0);
+            if (audioFound != _audioFound) {
+                CONFIG::LOGGING {
+                    if (audioFound) {
+                        Log.debug("TS: Found " + audioList.length + " audio tracks");
+                    }
+                }
+                _audioFound = audioFound;
+                var audioTrack : AudioTrack = _callback_audioselect(audioList);
+                if (audioTrack) {
+                    audioPID = audioTrack.id;
+                    _audioIsAAC = audioTrack.isAAC;
+                    _audioSelected = true;
+                    CONFIG::LOGGING {
+                        Log.debug("TS: selected " + (_audioIsAAC ? "AAC" : "MP3") + " PID: " + audioPID);
+                    }
+                } else {
+                    audioPID = -1;
+                    _audioSelected = false;
+                    CONFIG::LOGGING {
+                        Log.debug("TS: no audio selected");
+                    }
+                }
+                // in case audio PID change, flush any partially parsed audio PES packet
+                if (audioPID != _audioId) {
+                    _curAudioPES = null;
+                    _adtsFrameOverflow = null;
+                    _audioId = audioPID;
+                }
             }
             return len + pointerField;
         };


underscore made it in by mistake...

underscore made it in by mistake...

--- frameworks/projects/XML/src/main/flex/XML.as
+++ frameworks/projects/XML/src/main/flex/XML.as
@@ -707,7 +707,6 @@
 			var child:XML = _children[idx];
 			child.setParent(null);
 			_children.splice(idx,1);
-				_
 		}

 		/**


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

--- frameworks/projects/advancedgrids/src/mx/olap/IOLAPCustomAggregator.as
+++ frameworks/projects/advancedgrids/src/mx/olap/IOLAPCustomAggregator.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2009 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@1249654 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as
+++ frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as
@@ -0,0 +1,511 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.controls
+{
+
+import flash.events.Event;
+import flash.filesystem.File;
+import flash.text.TextLineMetrics;
+import mx.collections.CursorBookmark;
+import mx.controls.ComboBox;
+import mx.controls.fileSystemClasses.FileSystemControlHelper;
+import mx.core.ClassFactory;
+import mx.core.mx_internal;
+import mx.events.FileEvent;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the selected directory displayed by this control
+ *  changes for any reason.
+ *
+ *  @eventType mx.events.FileEvent.DIRECTORY_CHANGE
+ */
+[Event(name="directoryChange", type="mx.events.FileEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+/**
+ *  Specifies the icon that indicates
+ *  the root directories of the computer.
+ *  There is no default icon.
+ *  In MXML, you can use the following syntax to set this property:
+ *  computerIcon="@Embed(source='computerIcon.jpg');"
+ *
+ *  @default null
+ */
+[Style(name="computerIcon", type="Class", format="EmbeddedFile", inherit="no")]
+
+/**
+ *  Specifies the icon that indicates a directory.
+ *  The default icon is located in the Assets.swf file.
+ *  In MXML, you can use the following syntax to set this property:
+ *  directoryIcon="@Embed(source='directoryIcon.jpg');"
+ *
+ *  @default TreeNodeIcon
+ */
+[Style(name="directoryIcon", type="Class", format="EmbeddedFile", inherit="no")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[IconFile("FileSystemComboBox.png")]
+
+[ResourceBundle("aircontrols")]
+
+/**
+ *  The FileSystemComboBox control defines a combo box control for
+ *  navigating up the chain of ancestor directories from a specified
+ *  directory in a file system.
+ *  You often use this control with the FileSystemList and FileSystemTree
+ *  controls to change the current directory displayed by those controls.
+ *
+ *
To populate the dataProvider property,
+ *  you set the directory property.
+ *  This control then automatically sets the dataProvider
+ *  property to an ArrayCollection of File objects
+ *  that includes all the ancestor directories of the specified directory,
+ *  starting with the COMPUTER File
+ *  and ending with the specified directory.

+ *
+ *
When you select an entry in the dropdown list,
+ *  this control dispatches an Event.CHANGE event.
+ *  Afterwards the data provider, and therefore the dropdown list,
+ *  contains the selected directory's ancestors.

+ *
+ *  @see mx.controls.FileSystemList
+ *  @see mx.controls.FileSystemTree
+ */
+public class FileSystemComboBox extends ComboBox
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * A constant that can be used as a value for the directory property,
+	 * representing a pseudo-top level directory named "Computer". This pseudo-directory
+     * contains the root directories
+     * (such as C:\ and D:\ on Windows or / on Macintosh).
+     */
+    public static const COMPUTER:File = FileSystemControlHelper.COMPUTER;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function FileSystemComboBox()
+    {
+        super();
+
+        helper = new FileSystemControlHelper(this, false);
+
+        itemRenderer = new ClassFactory(FileSystemComboBoxRenderer);
+        labelFunction = helper.fileLabelFunction;
+        rowCount = 10;
+
+        addEventListener(Event.CHANGE, changeHandler);
+
+        directory = COMPUTER;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  An undocumented class that implements functionality
+     *  shared by various file system components.
+     */
+    mx_internal var helper:FileSystemControlHelper;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  directory
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the directory property.
+     */
+    private var _directory:File;
+
+    /**
+     *  @private
+     */
+    private var directoryChanged:Boolean = false;
+
+    [Bindable("directoryChanged")]
+
+    /**
+     *  A File object representing the directory
+     *  whose ancestors are to be displayed in this control.
+     *  The control displays each ancestor directory
+     *  as a separate entry in the dropdown list.
+     *
+     *  @default null
+     */
+    public function get directory():File
+    {
+        return _directory;
+    }
+
+    /**
+     *  @private
+     */
+    public function set directory(value:File):void
+    {
+        _directory = value;
+        directoryChanged = true;
+
+        invalidateProperties();
+
+		dispatchEvent(new Event("directoryChanged"));
+    }
+
+    //----------------------------------
+    //  indent
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the indent property.
+     */
+    private var _indent:int = 8;
+
+    /**
+     *  The number of pixels to indent each entry in the dropdown list.
+     *
+     *  @default 8
+     */
+    public function get indent():int
+    {
+        return _indent;
+    }
+
+    /**
+     *  @private
+     */
+    public function set indent(value:int):void
+    {
+        _indent = value;
+    }
+
+    //----------------------------------
+    //  showIcons
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the showIcons property.
+     */
+    private var _showIcons:Boolean = true;
+
+    /**
+     *  A flag that determines whether icons are displayed
+     *  before the directory names in the dropdown list.
+     *
+     *  @default true
+     */
+    public function get showIcons():Boolean
+    {
+        return _showIcons;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showIcons(value:Boolean):void
+    {
+        _showIcons = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (directoryChanged)
+        {
+            dataProvider = getParentChain(_directory);
+            selectedItem = _directory;
+
+			var event:FileEvent = new FileEvent(FileEvent.DIRECTORY_CHANGE);
+			event.file = _directory;
+			dispatchEvent(event);
+
+            directoryChanged = false;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function resourcesChanged():void
+    {
+        super.resourcesChanged();
+
+        // The name of the COMPUTER pseudo-directory is localizable.
+        // It appears at the top of the dropdown,
+        // and may also be displayed as the selected item.
+		invalidateSize();
+        invalidateDisplayList();
+		selectedIndex = selectedIndex;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function calculatePreferredSizeFromData(count:int):Object
+	{
+        var maxW:Number = 0;
+        var maxH:Number = 0;
+
+        var bookmark:CursorBookmark = iterator ? iterator.bookmark : null;
+
+        iterator.seek(CursorBookmark.FIRST, 0);
+
+        var more:Boolean = iterator != null;
+
+        var lineMetrics:TextLineMetrics;
+
+        for (var i:int = 0; i < count; i++)
+        {
+            var data:Object;
+            if (more)
+                data = iterator ? iterator.current : null;
+            else
+                data = null;
+
+            var txt:String = itemToLabel(data);
+
+            lineMetrics = measureText(txt);
+
+			lineMetrics.width += i * indent;
+
+            maxW = Math.max(maxW, lineMetrics.width);
+            maxH = Math.max(maxH, lineMetrics.height);
+
+            if (iterator)
+                iterator.moveNext();
+        }
+
+        if (prompt)
+        {
+            lineMetrics = measureText(prompt);
+
+            maxW = Math.max(maxW, lineMetrics.width);
+            maxH = Math.max(maxH, lineMetrics.height);
+        }
+
+        maxW += getStyle("paddingLeft") + getStyle("paddingRight");
+
+        if (iterator)
+            iterator.seek(bookmark, 0);
+
+        return { width: maxW, height: maxH };
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Returns an Array of File objects
+     *  representing the path to the specified directory.
+     *  The first File represents a root directory.
+     *  The last File represents the specified file's parent directory.
+     */
+    private function getParentChain(file:File):Array
+    {
+        if (helper.isComputer(file))
+            return [ file ];
+
+        var a:Array = [];
+
+        for (var f:File = file; f != null; f = f.parent)
+        {
+            a.unshift(f);
+        }
+
+        a.unshift(COMPUTER);
+
+        return a;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  When the user chooses a directory along the path,
+     *  change this control to display the path to that directory.
+     */
+    private function changeHandler(event:Event):void
+    {
+        directory = File(selectedItem);
+    }
+}
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Helper class: FileSystemComboBoxRenderer
+//
+////////////////////////////////////////////////////////////////////////////////
+
+import flash.display.DisplayObject;
+import flash.filesystem.File;
+import mx.controls.FileSystemComboBox;
+import mx.controls.fileSystemClasses.FileSystemControlHelper;
+import mx.controls.listClasses.ListItemRenderer;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+/**
+ *  @private
+ */
+class FileSystemComboBoxRenderer extends ListItemRenderer
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function FileSystemComboBoxRenderer()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (!listData || !data)
+            return;
+
+        var comboBox:FileSystemComboBox =
+            FileSystemComboBox(listData.owner.owner);
+        if (!comboBox.showIcons)
+            return;
+
+        var iconClass:Class = comboBox.getStyle(
+        	comboBox.helper.isComputer(File(data)) ?
+            "computerIcon" :
+            "directoryIcon");
+
+		if (iconClass)
+        {
+            icon = new iconClass();
+            addChild(DisplayObject(icon));
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        if (!listData || !data)
+            return;
+
+        var comboBox:FileSystemComboBox =
+            FileSystemComboBox(listData.owner.owner);
+        if (comboBox.indent == 0)
+            return;
+
+        var delta:Number = comboBox.indent * getNestLevel(File(data));
+        if (icon)
+            icon.x += delta;
+        label.x += delta;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function getNestLevel(item:File):int
+    {
+        if (!item || !item.exists)
+            return 0;
+
+        var nestLevel:int = 0;
+        for (var f:File = item; f != null; f = f.parent)
+        {
+            nestLevel++;
+        }
+        return nestLevel;
+    }
+}


fixed issue when moving an item that both sorted and filtered

--- frameworks/projects/framework/src/mx/collections/ListCollectionView.as
+++ frameworks/projects/framework/src/mx/collections/ListCollectionView.as
@@ -1479,7 +1479,7 @@
                 //if there is a property see if it affects the sort
                 updateEntry.move =
                     updateEntry.move
-                    || filterFunction
+                    || filterFunction != null && filterFunction(item)
                     || !updateInfo.property
                     || (sort && sort.propertyAffectsSort(String(updateInfo.property)));
             }
@@ -1665,7 +1665,10 @@
                 localIndex.splice(removeLocation, 1);
             }

-            var addLocation:int = addItemsToView([item], removeLocation, false);
+            var addLocation:int = -1;
+
+			if (filterFunction == null || filterFunction(item))
+				addLocation = addItemsToView([item], removeLocation, false);

             if (dispatch)
             {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as
+++ frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as
@@ -59,6 +59,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function DragProxy(dragInitiator:IUIComponent,
 							  dragSource:DragSource)
@@ -429,9 +434,19 @@
 							getObjectsUnderPoint(stagePoint);
 		else
 		{
+*
+*  @langversion 3.0
+*  @playerversion Flash 9
+*  @playerversion AIR 1.1
+*  @productversion Flex 3
 */			targetList = [];
 			DragProxy.getObjectsUnderPoint(DisplayObject(sandboxRoot), stagePoint, targetList);
 /*		}
+*
+*  @langversion 3.0
+*  @playerversion Flash 9
+*  @playerversion AIR 1.1
+*  @productversion Flex 3
 */
 		var newTarget:DisplayObject = null;
 		// trace("   ", targetList.length, "objects under point");
@@ -654,6 +669,11 @@

 	/**
 	 *  Player doesn't handle this correctly so we have to do it ourselves
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	private static function getObjectsUnderPoint(obj:DisplayObject, pt:Point, arr:Array):void
 	{


Transferred from the Adobe Open Source Subversion Repository

Revision: 18516
Author:   tkraikit@adobe.com
Date:     2010-11-10T01:06:50.972688Z

Log Message:
-----------
Fix for bug25059: HSlider shows wrong value when set to decimal increments and maximum=1 . Underlying Range.as was evaluating the value property before the snapInterval and stepSize properties were properly evaluated. Order of evaluation fixed, and documentation for snapInterval rewritten to hopefully make usage more clear.

QE notes: n/a
Doc notes: n/a
Bugs: SDK-25059
Reviewer: Ryan Frishberg, Kevin Lin
Tests run: checkintests, mustella via cyclone server
Is noteworthy for integration: n/a

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

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

--- frameworks/projects/spark/src/spark/components/supportClasses/Range.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/Range.as
@@ -12,499 +12,506 @@
 package spark.components.supportClasses
 {

-import mx.events.FlexEvent;
-
-/**
- *  The Range class holds a value and an allowed range for that
- *  value, defined by minimum and maximum properties.
- *  The value property
- *  is always constrained to be between the current minimum and
- *  maximum, and the minimum,
- *  and maximum are always constrained
- *  to be in the proper numerical order, such that
- *  (minimum <= value <= maximum) is true.
- *  If the value of the snapInterval property is not 0,
- *  then the value property is also constrained to be a multiple of
- *  snapInterval.
- *
- *
Range is a base class for various controls that require range
- *  functionality, including TrackBase and Spinner.

- *
- *  @mxml
- *
- *
The <s:Range> tag inherits all of the tag
- *  attributes of its superclass and adds the following tag attributes:

- *
- *

- *  <s:Range
- *    Properties
- *    maximum="100"
- *    minimum="0"
- *    snapInterval="1"
- *    stepSize="1"
- *    value="0"
- *  />
- *

- *
- *  @see spark.components.supportClasses.TrackBase
- *  @see spark.components.Spinner
- *
- *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
- */
-public class Range extends SkinnableComponent
-{
-    include "../../core/Version.as";
-
-    //--------------------------------------------------------------------------
-    //
-    //  Constructor
-    //
-    //--------------------------------------------------------------------------
-
+    import mx.events.FlexEvent;
+
     /**
-     *  Constructor.
+     *  The Range class holds a value and an allowed range for that
+     *  value, defined by minimum and maximum properties.
+     *  The value property
+     *  is always constrained to be between the current minimum and
+     *  maximum, and the minimum,
+     *  and maximum are always constrained
+     *  to be in the proper numerical order, such that
+     *  (minimum <= value <= maximum) is true.
+     *  If the value of the snapInterval property is not 0,
+     *  then the value property is also constrained to be a multiple of
+     *  snapInterval.
+     *
+     *
Range is a base class for various controls that require range
+     *  functionality, including TrackBase and Spinner.

+     *
+     *  @mxml
+     *
+     *
The <s:Range> tag inherits all of the tag
+     *  attributes of its superclass and adds the following tag attributes:

+     *
+     *

+     *  <s:Range
+     *    Properties
+     *    maximum="100"
+     *    minimum="0"
+     *    snapInterval="1"
+     *    stepSize="1"
+     *    value="0"
+     *  />
+     *

+     *
+     *  @see spark.components.supportClasses.TrackBase
+     *  @see spark.components.Spinner
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
-     */
-    public function Range():void
+     */
+    public class Range extends SkinnableComponent
     {
-        super();
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties
-    //
-    //--------------------------------------------------------------------------
-
-    //---------------------------------
-    // maximum
-    //---------------------------------
-
-    private var _maximum:Number = 100;
-
-    private var maxChanged:Boolean = false;
-
-    /**
-     *  The maximum valid value.
-     *
-     *
Changes to the value property are constrained
-     *  by commitProperties() to be less than or equal to
-     *  maximum with the nearestValidValue() method.

-     *
-     *  @default 100
-     *  @see #nearestValidValue
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get maximum():Number
-    {
-        return _maximum;
-    }
-
-    public function set maximum(value:Number):void
-    {
-        if (value == _maximum)
-            return;
-
-        _maximum = value;
-        maxChanged = true;
-
-        invalidateProperties();
-    }
-
-    //---------------------------------
-    // minimum
-    //---------------------------------
-
-    private var _minimum:Number = 0;
-
-    private var minChanged:Boolean = false;
-
-    /**
-     *  The minimum valid value.
-     *
-     *
Changes to the value property are constrained
-     *  by commitProperties() to be greater than or equal to
-     *  minimum with the nearestValidValue() method.

-     *
-     *  @default 0
-     *  @see #nearestValidValue
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get minimum():Number
-    {
-        return _minimum;
-    }
-
-    public function set minimum(value:Number):void
-    {
-        if (value == _minimum)
-            return;
-
-        _minimum = value;
-        minChanged = true;
-
-        invalidateProperties();
-    }
-
-    //---------------------------------
-    // stepSize
-    //---------------------------------
-
-    private var _stepSize:Number = 1;
-
-    private var stepSizeChanged:Boolean = false;
-
-    [Inspectable(minValue="0.0")]
-
-    /**
-     *  The amount that the value property
-     *  changes when the changeValueByStep() method is called. It must
-     *  be a multiple of snapInterval, unless
-     *  snapInterval is 0.
-     *  If stepSize
-     *  is not a multiple, it is rounded to the nearest
-     *  multiple that is greater than or equal to snapInterval.
-     *
-     *  @default 1
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get stepSize():Number
-    {
-        return _stepSize;
-    }
-
-    public function set stepSize(value:Number):void
-    {
-        if (value == _stepSize)
-            return;
-
-        _stepSize = value;
-        stepSizeChanged = true;
-
-        invalidateProperties();
-    }
-
-    //---------------------------------
-    // value
-    //---------------------------------
-
-    private var _value:Number = 0;
-    private var _changedValue:Number = 0;
-    private var valueChanged:Boolean = false;
-
-    [Bindable(event="valueCommit")]
-
-    /**
-     *  The current value for this range.
-     *
-     *
Changes to the value property are constrained
-     *  by commitProperties() to be greater than or equal to
-     *  the minimum property, less than or equal to the maximum property, and a
-     *  multiple of snapInterval with the nearestValidValue()
-     *  method.

-     *
-     *  @default 0
-     *  @see #setValue
-     *  @see #nearestValidValue
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get value():Number
-    {
-        return (valueChanged) ? _changedValue : _value;
-    }
-
-
-    /**
-     *  @private
-     *  Implementation note: we temporarily store the new value in
-     *  _changedValue and then update _value, by calling setValue()
-     *  in commitProperties().  Only one "valueCommit" event is
-     *  dispatched, even if this property has effectively changed
-     *  twice per nearestValidValue().
-     */
-    public function set value(newValue:Number):void
-    {
-        if (newValue == value)
-            return;
-        _changedValue = newValue;
-        valueChanged = true;
-        invalidateProperties();
-    }
-
-    //---------------------------------
-    // snapInterval
-    //---------------------------------
-
-    private var _snapInterval:Number = 1;
-
-    private var snapIntervalChanged:Boolean = false;
-    private var _explicitSnapInterval:Boolean = false;
-
-    [Inspectable(minValue="0.0")]
-
-    /**
-     *  If nonzero, valid values are the sum of the minimum with integer multiples
-     *  of this property and less than or equal to the maximum.
-     *
-     *
If the value of this property is zero, then valid values are only constrained
-     *  to be between minimum and maximum inclusive.

-     *
-     *
This property also constrains valid values for the stepSize property when set.
-     *  If this property is not explicitly set and stepSize is set,
-     *  then snapInterval defaults to stepSize.

-     *
-     *  @default 1
-     *  @see #nearestValidValue
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get snapInterval():Number
-    {
-        return _snapInterval;
-    }
-
-    public function set snapInterval(value:Number):void
-    {
-        // snapInterval defaults to stepSize if snapInterval is not
-        // explicitly set.
-        _explicitSnapInterval = true;
-
-        if (value == _snapInterval)
-            return;
-
-        // NaN effectively clears the snapInterval and resets it to 1.
-        if (isNaN(value))
-        {
-            _snapInterval = 1;
-            _explicitSnapInterval = false;
-        }
-        else
-        {
-            _snapInterval = value;
-        }
-
-        snapIntervalChanged = true;
-        stepSizeChanged = true;
-
-        invalidateProperties();
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    override protected function commitProperties():void
-    {
-        super.commitProperties();
-
-        if (minimum > maximum)
-        {
-            // Check min <= max
-            if (!maxChanged)
-                _minimum = _maximum;
-            else
-                _maximum = _minimum;
-        }
-
-        if (valueChanged || maxChanged || minChanged || snapIntervalChanged)
-        {
-            var currentValue:Number = (valueChanged) ? _changedValue : _value;
-            valueChanged = false;
-            maxChanged = false;
-            minChanged = false;
-            snapIntervalChanged = false;
-            setValue(nearestValidValue(currentValue, snapInterval));
-        }
-
-        if (stepSizeChanged)
-        {
-            // Only modify stepSize if snapInterval was explicitly set.
-            // Otherwise, snapInterval defaults to stepSize and we set
-            // the value to respect the new snapInterval.
-            if (_explicitSnapInterval)
+        include "../../core/Version.as";
+
+        //--------------------------------------------------------------------------
+        //
+        //  Constructor
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function Range():void
+        {
+            super();
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Properties
+        //
+        //--------------------------------------------------------------------------
+
+        //---------------------------------
+        // maximum
+        //---------------------------------
+
+        private var _maximum:Number = 100;
+
+        private var maxChanged:Boolean = false;
+
+        /**
+         *  The maximum valid value.
+         *
+         *
Changes to the value property are constrained
+         *  by commitProperties() to be less than or equal to
+         *  maximum with the nearestValidValue() method.

+         *
+         *  @default 100
+         *  @see #nearestValidValue
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get maximum():Number
+        {
+            return _maximum;
+        }
+
+        public function set maximum(value:Number):void
+        {
+            if (value == _maximum)
+                return;
+
+            _maximum = value;
+            maxChanged = true;
+
+            invalidateProperties();
+        }
+
+        //---------------------------------
+        // minimum
+        //---------------------------------
+
+        private var _minimum:Number = 0;
+
+        private var minChanged:Boolean = false;
+
+        /**
+         *  The minimum valid value.
+         *
+         *
Changes to the value property are constrained
+         *  by commitProperties() to be greater than or equal to
+         *  minimum with the nearestValidValue() method.

+         *
+         *  @default 0
+         *  @see #nearestValidValue
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get minimum():Number
+        {
+            return _minimum;
+        }
+
+        public function set minimum(value:Number):void
+        {
+            if (value == _minimum)
+                return;
+
+            _minimum = value;
+            minChanged = true;
+
+            invalidateProperties();
+        }
+
+        //---------------------------------
+        // stepSize
+        //---------------------------------
+
+        private var _stepSize:Number = 1;
+
+        private var stepSizeChanged:Boolean = false;
+
+        [Inspectable(minValue="0.0")]
+
+        /**
+         *  The amount that the value property
+         *  changes when the changeValueByStep() method is called. It must
+         *  be a multiple of snapInterval, unless
+         *  snapInterval is 0.
+         *  If stepSize
+         *  is not a multiple, it is rounded to the nearest
+         *  multiple that is greater than or equal to snapInterval.
+         *
+         *  @default 1
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get stepSize():Number
+        {
+            return _stepSize;
+        }
+
+        public function set stepSize(value:Number):void
+        {
+            if (value == _stepSize)
+                return;
+
+            _stepSize = value;
+            stepSizeChanged = true;
+
+            invalidateProperties();
+        }
+
+        //---------------------------------
+        // value
+        //---------------------------------
+
+        private var _value:Number = 0;
+        private var _changedValue:Number = 0;
+        private var valueChanged:Boolean = false;
+
+        [Bindable(event="valueCommit")]
+
+        /**
+         *  The current value for this range.
+         *
+         *
Changes to the value property are constrained
+         *  by commitProperties() to be greater than or equal to
+         *  the minimum property, less than or equal to the maximum property, and a
+         *  multiple of snapInterval with the nearestValidValue()
+         *  method.

+         *
+         *  @default 0
+         *  @see #setValue
+         *  @see #nearestValidValue
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get value():Number
+        {
+            return (valueChanged) ? _changedValue : _value;
+        }
+
+
+        /**
+         *  @private
+         *  Implementation note: we temporarily store the new value in
+         *  _changedValue and then update _value, by calling setValue()
+         *  in commitProperties().  Only one "valueCommit" event is
+         *  dispatched, even if this property has effectively changed
+         *  twice per nearestValidValue().
+         */
+        public function set value(newValue:Number):void
+        {
+            if (newValue == value)
+                return;
+            _changedValue = newValue;
+            valueChanged = true;
+            invalidateProperties();
+        }
+
+        //---------------------------------
+        // snapInterval
+        //---------------------------------
+
+        private var _snapInterval:Number = 1;
+
+        private var snapIntervalChanged:Boolean = false;
+        private var _explicitSnapInterval:Boolean = false;
+
+        [Inspectable(minValue="0.0")]
+
+        /**
+         *  The snapInterval property controls the valid values of the value property.
+         *
+         *  If nonzero, valid values are the sum of the minimum and integer multiples
+         *  of this property, for all sums that are less than or equal to the maximum.
+         *
+         *
For example, if minimum is 10, maximum is 20, and this property is 3, then the
+         *  valid values of this Range are 10, 13, 16, 19, and 20.

+         *
+         *
If the value of this property is zero, then valid values are only constrained
+         *  to be between minimum and maximum inclusive.

+         *
+         *
This property also constrains valid values for the stepSize property when set.
+         *  If this property is not explicitly set and stepSize is set,
+         *  then snapInterval defaults to stepSize.

+         *
+         *  @default 1
+         *  @see #nearestValidValue
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function get snapInterval():Number
+        {
+            return _snapInterval;
+        }
+
+        public function set snapInterval(value:Number):void
+        {
+            // snapInterval defaults to stepSize if snapInterval is not
+            // explicitly set.
+            _explicitSnapInterval = true;
+
+            if (value == _snapInterval)
+                return;
+
+            // NaN effectively clears the snapInterval and resets it to 1.
+            if (isNaN(value))
             {
-                _stepSize = nearestValidSize(_stepSize);
+                _snapInterval = 1;
+                _explicitSnapInterval = false;
             }
             else
             {
-                _snapInterval = _stepSize;
-                setValue(nearestValidValue(_value, snapInterval));
+                _snapInterval = value;
             }

-            stepSizeChanged = false;
-        }
-    }
-
-    /**
-     *  @private
-     *  Returns the integer multiple of snapInterval that's closest to size.
-     *
-     *
If snapInterval is 0, which means that values are only constrained
-     *  by the minimum and maximum properties, then size is returned unchanged.

-     *
-     *
This method is used by commitProperties() to validate the
-     *  stepSize.

-     *
-     *  @param size The input size.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    private function nearestValidSize(size:Number):Number
-    {
-        var interval:Number = snapInterval;
-        if (interval == 0)
-            return size;
-
-        var validSize:Number = Math.round(size / interval) * interval
-        return (Math.abs(validSize) < interval) ? interval : validSize;
+            snapIntervalChanged = true;
+            stepSizeChanged = true;
+
+            invalidateProperties();
+        }
+
+        //--------------------------------------------------------------------------
+        //
+        //  Methods
+        //
+        //--------------------------------------------------------------------------
+
+        /**
+         *  @private
+         */
+        override protected function commitProperties():void
+        {
+            super.commitProperties();
+
+            // Check min <= max
+            if (minimum > maximum)
+            {
+                if (!maxChanged)
+                    _minimum = _maximum;
+                else
+                    _maximum = _minimum;
+            }
+
+            // determine which takes priority, stepSize or snapInterval, based
+            // on whether either or both have been set
+            if (stepSizeChanged || snapIntervalChanged)
+            {
+                if (_explicitSnapInterval)
+                {
+                    // If snapInterval was explicitly set, stepSize always conforms to match
+                    _stepSize = nearestValidSize(_stepSize);
+                    stepSizeChanged = true; // technically not necessary
+                }
+                else
+                {
+                    // Otherwise, snapInterval defaults to stepSize
+                    _snapInterval = _stepSize;
+                    snapIntervalChanged = true; // technically not necessary
+                }
+            }
+
+            // if anything has changed, re-evaluate value
+            if (valueChanged || maxChanged || minChanged || stepSizeChanged || snapIntervalChanged)
+            {
+                var currentValue:Number = (valueChanged) ? _changedValue : _value;
+                valueChanged = false;
+                maxChanged = false;
+                minChanged = false;
+                stepSizeChanged = false;
+                snapIntervalChanged = false;
+                setValue(nearestValidValue(currentValue, snapInterval));
+            }
+        }
+
+        /**
+         *  @private
+         *  Returns the integer multiple of snapInterval that's closest to size.
+         *
+         *
If snapInterval is 0, which means that values are only constrained
+         *  by the minimum and maximum properties, then size is returned unchanged.

+         *
+         *
This method is used by commitProperties() to validate the
+         *  stepSize.

+         *
+         *  @param size The input size.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        private function nearestValidSize(size:Number):Number
+        {
+            var interval:Number = snapInterval;
+            if (interval == 0)
+                return size;
+
+            var validSize:Number = Math.round(size / interval) * interval
+            return (Math.abs(validSize) < interval) ? interval : validSize;
+        }
+
+        /**
+         *  Returns the sum of the minimum with an integer multiple of interval that's
+         *  closest to value, unless value is closer to the maximum limit,
+         *  in which case the maximum is returned.
+         *
+         *
If interval is equal to 0, the value is clipped to the minimum and maximum
+         *  limits.

+         *
+         *
The valid values for a range are defined by the sum of the minimum property
+         *  with multiples of the interval and also defined to be less than or equal to the
+         *  maximum property.
+         *
+         *  The maximum need not be a multiple of snapInterval.

+         *
+         *
For example, if minimum is equal to 1, maximum is equal to 6,
+         *  and snapInterval is equal to 2, the valid
+         *  values for the Range are 1, 3, 5, 6.
+         *
+         *  Similarly, if minimum is equal to 2, maximum is equal to 9,
+         *  and snapInterval is equal to 1.5, the valid
+         *  values for the Range are 2, 3.5, 5, 6.5, 8, and 9.

+         *
+         *  @param value The input value.
+         *  @param interval The value of snapInterval or an integer multiple of snapInterval.
+         *  @return The valid value that's closest to the input.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        protected function nearestValidValue(value:Number, interval:Number):Number
+        {
+            if (interval == 0)
+                return Math.max(minimum, Math.min(maximum, value));
+
+            var maxValue:Number = maximum - minimum;
+            var scale:Number = 1;
+
+            value -= minimum;
+
+            // If interval isn't an integer, there's a possibility that the floating point
+            // approximation of value or value/interval will be slightly larger or smaller
+            // than the real value.  This can lead to errors in calculations like
+            // floor(value/interval)*interval, which one might expect to just equal value,
+            // when value is an exact multiple of interval.  Not so if value=0.58 and
+            // interval=0.01, in that case the calculation yields 0.57!  To avoid problems,
+            // we scale by the implicit precision of the interval and then round.  For
+            // example if interval=0.01, then we scale by 100.
+
+            if (interval != Math.round(interval))
+            {
+                const parts:Array = (new String(1 + interval)).split(".");
+                scale = Math.pow(10, parts[1].length);
+                maxValue *= scale;
+                value = Math.round(value * scale);
+                interval = Math.round(interval * scale);
+            }
+
+            var lower:Number = Math.max(0, Math.floor(value / interval) * interval);
+            var upper:Number = Math.min(maxValue, Math.floor((value + interval) / interval) * interval);
+            var validValue:Number = ((value - lower) >= ((upper - lower) / 2)) ? upper : lower;
+
+            return (validValue / scale) + minimum;
+        }
+
+        /**
+         *  Sets the backing store for the value property and
+         *  dispatches a valueCommit event if the property changes.
+         *
+         *
All updates to the value property cause a call to this method.

+         *
+         *
This method assumes that the caller has already used the nearestValidValue() method
+         *  to constrain the value parameter

+         *
+         *  @param value The new value of the value property.
+         *  @see #nearestValidValue
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        protected function setValue(value:Number):void
+        {
+            if (_value == value)
+                return;
+            if (!isNaN(maximum) && !isNaN(minimum) && (maximum > minimum))
+                _value = Math.min(maximum, Math.max(minimum, value));
+            else
+                _value = value;
+            dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+        }
+
+        /**
+         *  Increases or decreases value by stepSize.
+         *
+         *  @param increase If true, adds stepSize to value, otherwise, subtracts it.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10
+         *  @playerversion AIR 1.5
+         *  @productversion Flex 4
+         */
+        public function changeValueByStep(increase:Boolean = true):void
+        {
+            if (stepSize == 0)
+                return;
+
+            var newValue:Number = (increase) ? value + stepSize : value - stepSize;
+            setValue(nearestValidValue(newValue, snapInterval));
+        }
     }

-    /**
-     *  Returns the sum of the minimum with an integer multiple of interval that's
-     *  closest to value, unless value is closer to the maximum limit,
-     *  in which case the maximum is returned.
-     *
-     *
If interval is equal to 0, the value is clipped to the minimum and maximum
-     *  limits.

-     *
-     *
The valid values for a range are defined by the sum of the minimum property
-     *  with multiples of the interval and also defined to be less than or equal to the
-     *  maximum property.
-     *
-     *  The maximum need not be a multiple of snapInterval.

-     *
-     *
For example, if minimum is equal to 1, maximum is equal to 6,
-     *  and snapInterval is equal to 2, the valid
-     *  values for the Range are 1, 3, 5, 6.
-     *
-     *  Similarly, if minimum is equal to 2, maximum is equal to 9,
-     *  and snapInterval is equal to 1.5, the valid
-     *  values for the Range are 2, 3.5, 5, 6.5, 8, and 9.

-     *
-     *  @param value The input value.
-     *  @param interval The value of snapInterval or an integer multiple of snapInterval.
-     *  @return The valid value that's closest to the input.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function nearestValidValue(value:Number, interval:Number):Number
-    {
-        if (interval == 0)
-            return Math.max(minimum, Math.min(maximum, value));
-
-        var maxValue:Number = maximum - minimum;
-        var scale:Number = 1;
-
-        value -= minimum;
-
-        // If interval isn't an integer, there's a possibility that the floating point
-        // approximation of value or value/interval will be slightly larger or smaller
-        // than the real value.  This can lead to errors in calculations like
-        // floor(value/interval)*interval, which one might expect to just equal value,
-        // when value is an exact multiple of interval.  Not so if value=0.58 and
-        // interval=0.01, in that case the calculation yields 0.57!  To avoid problems,
-        // we scale by the implicit precision of the interval and then round.  For
-        // example if interval=0.01, then we scale by 100.
-
-        if (interval != Math.round(interval))
-        {
-            const parts:Array = (new String(1 + interval)).split(".");
-            scale = Math.pow(10, parts[1].length);
-            maxValue *= scale;
-            value = Math.round(value * scale);
-            interval = Math.round(interval * scale);
-        }
-
-        var lower:Number = Math.max(0, Math.floor(value / interval) * interval);
-        var upper:Number = Math.min(maxValue, Math.floor((value + interval) / interval) * interval);
-        var validValue:Number = ((value - lower) >= ((upper - lower) / 2)) ? upper : lower;
-
-        return (validValue / scale) + minimum;
-    }
-
-    /**
-     *  Sets the backing store for the value property and
-     *  dispatches a valueCommit event if the property changes.
-     *
-     *
All updates to the value property cause a call to this method.

-     *
-     *
This method assumes that the caller has already used the nearestValidValue() method
-     *  to constrain the value parameter

-     *
-     *  @param value The new value of the value property.
-     *  @see #nearestValidValue
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    protected function setValue(value:Number):void
-    {
-        if (_value == value)
-            return;
-        if (!isNaN(maximum) && !isNaN(minimum) && (maximum > minimum))
-            _value = Math.min(maximum, Math.max(minimum, value));
-        else
-            _value = value;
-        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
-    }
-
-    /**
-     *  Increases or decreases value by stepSize.
-     *
-     *  @param increase If true, adds stepSize to value, otherwise, subtracts it.
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function changeValueByStep(increase:Boolean = true):void
-    {
-        if (stepSize == 0)
-            return;
-
-        var newValue:Number = (increase) ? value + stepSize : value - stepSize;
-        setValue(nearestValidValue(newValue, snapInterval));
-    }
-}
-
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5573
Author:   jimurphy@adobe.com
Date:     2009-03-26T15:11:59.159776Z

Log Message:
-----------
-more updated package and class names that were missed in the first pass
-remove the mx folder

qa: probably
doc: this updated more asdoc comments so you may want to make sure that this pass made the correct updates
checkintests: pass

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoDisplay.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/interpolation/HSBInterpolator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/SetActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/IGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/easing/IEaser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/Animate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/DataGroupExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateShaderTransition.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformScale.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="dir" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/pathSegments/PathSegment.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/animation/Animation.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/asdoc/en_US/mx/components/examples/FxToggleButtonExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/AddActionInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/events/AnimationEvent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/WipeInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformMove3D.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/AnimateTransformRotate.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/SetAction.as</path>

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

--- frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as
+++ frameworks/projects/spark/src/spark/effects/AnimateTransitionShader.as
@@ -71,7 +71,7 @@
  * these bitmap-based effects, they should be played alone on
  * their target objects.</p>
  *
- * @see mx.graphics.GraphicElement
+ * @see spark.primitives.GraphicElement
  * @see flash.display.DisplayObject
  *
  *  @langversion 3.0


Transferred from the Adobe Open Source Subversion Repository

Revision: 10647
Author:   preilly@adobe.com
Date:     2009-09-28T17:21:59.390445Z

Log Message:
-----------
* A batch of compiler fixes.

QE notes:
Doc notes:
Bugs: SDK-22258, SDK-21547, SDK-22879, SDK-23169, SDK-23336
Reviewer: Edwin (ActionFactory.java), Ryan (VideoPlayer.as), Corey
Tests run: full cyclone
Is noteworthy for integration: Yes, HostComponent, SkinPart, and
                               SkinState metadata is now validated by
                               the compiler.
Code-level description of changes:

  frameworks/projects/spark/src/spark/skins/spark/BorderSkin.as

    Made HostComponent fully qualified.

  frameworks/projects/spark/src/spark/components/VideoPlayer.as

    Updated SkinState metadata to reflect revision 7732.

  modules/swfutils/src/java/flash/swf/ActionFactory.java

    Made getLabel() more bullet proof.

  modules/compiler/src/java/flex2/compiler_en.properties

    Added as3.HostComponentExtension.HostComponentClassNotFound,
    as3.HostComponentExtension.MissingSkinPart,
    as3.HostComponentExtension.MissingSkinState,
    as3.SyntaxTreeEvaluator.OnlyOneHostComponentAllowed, and
    as3.SyntaxTreeEvaluator.SkinPartsMustBePublic.

  modules/compiler/src/java/flex2/compiler/CompilationUnit.java

    Replaced hasHostComponentMD with hostComponentMetaData.

  modules/compiler/src/java/flex2/compiler/as3/genext/GenerativeClassInfo.java

    Modified getImports() to support Vectors.

  modules/compiler/src/java/flex2/compiler/as3/HostComponentEvaluator.java

    Removed, because we really don't need to evaluate the AST again to
    find the HostComponent metadata since SyntaxTreeEvaluator has
    already found it.

  modules/compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java

    Modified generateTypeExpression() and generateVariable() to
    support passing in a position.

  modules/compiler/src/java/flex2/compiler/as3/SyntaxTreeEvaluator.java

    Modified evaluate(Context, MetaDataNode) to handle [SkinPart].

    Modified processHostComponentMetaData() to store the node in the
    CompilationUnit and report an error if more than one HostComponent
    is found.

    Added processSkinPartMetaData().

  modules/compiler/src/java/flex2/compiler/as3/HostComponentExtension.java

    Refactored to handle what HostComponentEvaluator was doing, plus
    validate HostComponent, SkinPart and SkinState metadata.

  modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java

    Modified generateDefinitionBody() to store a line number mapped
    position for the variable definition.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/genext/GenerativeClassInfo.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler_en.properties</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/swfutils/src/java/flash/swf/ActionFactory.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilationUnit.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/SyntaxTreeEvaluator.java</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/HostComponentExtension.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/init/ValueInitializer.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/BorderSkin.as</path>
<path kind="file" action="D">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/HostComponentEvaluator.java</path>

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

--- frameworks/projects/spark/src/spark/skins/spark/BorderContainerSkin.as
+++ frameworks/projects/spark/src/spark/skins/spark/BorderContainerSkin.as
@@ -25,7 +25,7 @@
 import spark.primitives.Path;
 import spark.primitives.Rect;

-[HostComponent("Border")]
+[HostComponent("spark.components.Border")]

 /**
  *  The default skin class for a Spark Border container.


Line wrappery.

Line wrappery.

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

--- src/as/com/threerings/flash/TextFieldUtil.as
+++ src/as/com/threerings/flash/TextFieldUtil.as
@@ -53,7 +53,8 @@
      * the specified width.
      * @return true if truncation took place
      */
-    public static function setMaximumTextWidth (tf :TextField, width :Number, truncationString :String = "...") :Boolean
+    public static function setMaximumTextWidth (
+        tf :TextField, width :Number, truncationString :String = "...") :Boolean
     {
         if (tf.numLines > 1) {
             // We only operate on single-line TextFields


fixed bug calculating GC time

fixed bug calculating GC time

Change-Id: I5aeb6c36e20fb11b07d108c9cef5399491acc5e2

--- WeaveCore/src/weave/core/StageUtils.as
+++ WeaveCore/src/weave/core/StageUtils.as
@@ -326,7 +326,8 @@
 			{
 				var t:int = getTimer();
 				pauseForGCIfCollectionImminent();
-				if (getTimer() - t > maxComputationTimePerFrame)
+				t = getTimer() - t;
+				if (t > maxComputationTimePerFrame)
 					trace('paused',t,'ms for GC');
 			}
 			var queue:Array = _priorityCallLaterQueues[WeaveAPI.TASK_PRIORITY_IMMEDIATE] as Array;


Stop dumping the textures individually

Stop dumping the textures individually

--- src/main/as/flump/export/Exporter.as
+++ src/main/as/flump/export/Exporter.as
@@ -105,8 +105,7 @@

     protected function exportFlashDocument (status :DocStatus) :void {
         const exportDir :File = new File(_exportChooser.dir);
-        PngPublisher.dumpTextures(exportDir, status.lib);
-        BetwixtPublisher.export(status.lib, status.file, exportDir);
+        BetwixtPublisher.publish(status.lib, status.file, exportDir);
         status.updateModified(Ternary.FALSE);
     }


disabled debug trace

disabled debug trace

--- WeaveCore/src/weave/core/SessionManager.as
+++ WeaveCore/src/weave/core/SessionManager.as
@@ -57,6 +57,8 @@
 	 */
 	public class SessionManager implements ISessionManager
 	{
+		public static var debugBusyTasks:Boolean = false;
+
 		/**
 		 * This function will create a new instance of the specified child class and register it as a child of the parent.
 		 * If a callback function is given, the callback will be added to the child and cleaned up when the parent is disposed of.
@@ -663,8 +665,8 @@
 		 */
 		public function assignBusyTask(taskToken:Object, busyObject:ILinkableObject):void
 		{
-			//if (debug)
-				_dTaskStackTrace[taskToken] = new Error("Assign busy task").getStackTrace();
+			if (debugBusyTasks)
+				_dTaskStackTrace[taskToken] = new Error("Stack trace").getStackTrace();

 			if (taskToken is AsyncToken)
 				(taskToken as AsyncToken).addResponder(new AsyncResponder(unassignAsyncToken, unassignAsyncToken, taskToken));
@@ -709,8 +711,11 @@
 				// if the object is assigned a task, it's busy
 				for (var task:Object in _d2dOwnerTask.dictionary[linkableObject])
 				{
-					var stackTrace:String = _dTaskStackTrace[task];
-					trace(stackTrace);
+					if (debugBusyTasks)
+					{
+						var stackTrace:String = _dTaskStackTrace[task];
+						trace(stackTrace);
+					}
 					busy = true;
 					break outerLoop;
 				}


xNumericMin now returns xMin when either xMin or xMax is NaN.
Related Bounds2D functions now behave in the same way.

Change-Id: I1ef8ff0ad0633f3816ea90a6e398ee3eba0b1ed3

--- WeaveData/src/weave/primitives/Bounds2D.as
+++ WeaveData/src/weave/primitives/Bounds2D.as
@@ -866,7 +866,7 @@
 		 */
 		public function getXNumericMin():Number
 		{
-			return xMin < xMax ? xMin : xMax; // Math.min(xMin, xMax);
+			return xMax < xMin ? xMax : xMin; // if any are NaN, returns xMin
 		}
 		/**
 		 * The yNumericMin is defined as the minimum of yMin and yMax.
@@ -874,7 +874,7 @@
 		 */
 		public function getYNumericMin():Number
 		{
-			return yMin < yMax ? yMin : yMax; // Math.min(yMin, yMax);
+			return yMax < yMin ? yMax : yMin; // if any are NaN, returns yMin
 		}
 		/**
 		 * The xNumericMax is defined as the maximum of xMin and xMax.
@@ -882,7 +882,7 @@
 		 */
 		public function getXNumericMax():Number
 		{
-			return xMax > xMin ? xMax : xMin; // Math.max(xMin, xMax);
+			return xMax < xMin ? xMin : xMax; // if any are NaN, returns xMax
 		}
 		/**
 		 * The xNumericMax is defined as the maximum of xMin and xMax.
@@ -890,7 +890,7 @@
 		 */
 		public function getYNumericMax():Number
 		{
-			return yMax > yMin ? yMax : yMin; // Math.max(yMin, yMax);
+			return yMax < yMin ? yMin : yMax; // if any are NaN, returns yMax
 		}

 		/**


made debug property public

made debug property public

--- WeaveUISpark/src/weave/utils/BitmapText.as
+++ WeaveUISpark/src/weave/utils/BitmapText.as
@@ -55,7 +55,7 @@
 			textFormat.color = 0x000000;
 		}

-		private const debug:Boolean = false; // set to true to draw debug graphics
+		public var debug:Boolean = false; // set to true to draw debug graphics

 		public static const DEFAULT_FONT_FAMILY:String = LinkableTextFormat.DEFAULT_FONT;


Transferred from the Adobe Open Source Subversion Repository

Revision: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/framework/src/mx/core/EmbeddedFont.as
+++ frameworks/projects/framework/src/mx/core/EmbeddedFont.as
@@ -38,6 +38,11 @@
 	 *  @param bold true if the font is bold, false otherwise.
 	 *
 	 *  @param italic true if the fotn is italic, false otherwise,
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function EmbeddedFont(fontName:String, bold:Boolean, italic:Boolean)
 	{
@@ -65,6 +70,11 @@

 	/**
 	 *  The name of the font.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function get fontName():String
 	{
@@ -84,6 +94,11 @@
 	/**
 	 *  The style of the font.
 	 *  The value is one of the values in flash.text.FontStyle.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function get fontStyle():String
 	{


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

--- frameworks/projects/framework/src/mx/core/IStateClient.as
+++ frameworks/projects/framework/src/mx/core/IStateClient.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.core
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 16665
Author:   rfrishbe@adobe.com
Date:     2010-06-24T22:40:15.397962Z

Log Message:
-----------
Initial checkin for touch-enabled Lists.  This has not been code reviewed or spec-approved.  There will be lots of changes that will occur with this, but this will allow people to easily create touch-enabled Lists

QE notes: None
Doc notes: None
Bugs: -
Reviewer: None - this will get reviewed later
Tests run: checkintests, full mustella run (some tests failed and were off by a few pixels)
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ScrollerLayout.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TouchScrollingEasing.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/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/events/TouchScrollEvent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/core/IViewport.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/core/ScrollPolicy.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarThumbSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>

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

--- frameworks/projects/framework/src/mx/core/ScrollPolicy.as
+++ frameworks/projects/framework/src/mx/core/ScrollPolicy.as
@@ -70,6 +70,16 @@
 	 *  @productversion Flex 3
 	 */
 	public static const ON:String = "on";
+
+    /**
+     *  @private
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static const OVERLAY:String = "overlay";
 }

 }


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

--- frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as
+++ frameworks/projects/mx/src/mx/controls/PopUpMenuButton.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2005-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: 5101
Author:   gauravj@adobe.com
Date:     2009-02-27T05:22:45.887116Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
663 paths were modified

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

--- frameworks/projects/mx/src/mx/skins/halo/LinkSeparator.as
+++ frameworks/projects/mx/src/mx/skins/halo/LinkSeparator.as
@@ -21,6 +21,11 @@

 /**
  *  The skin for the separator between the Links in a LinkBar.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class LinkSeparator extends ProgrammaticSkin
 {
@@ -34,6 +39,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function LinkSeparator()
 	{
@@ -83,6 +93,11 @@

 	/**
 	 *  We don't use 'is' to prevent dependency issues
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	private static var boxes:Object = {};


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

--- frameworks/projects/charts/src/mx/charts/renderers/WedgeItemRenderer.as
+++ frameworks/projects/charts/src/mx/charts/renderers/WedgeItemRenderer.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.charts.renderers
 {