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

--- frameworks/projects/framework/src/mx/validators/CurrencyValidator.as
+++ frameworks/projects/framework/src/mx/validators/CurrencyValidator.as
@@ -0,0 +1,1162 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-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.validators
+{
+
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+
+[ResourceBundle("SharedResources")]
+[ResourceBundle("validators")]
+
+/**
+ *  The CurrencyValidator class ensures that a String
+ *  represents a valid currency expression.
+ *  It can make sure the input falls within a given range
+ *  (specified by minValue and maxValue),
+ *  is non-negative (specified by allowNegative),
+ *  and does not exceed the specified precision. The
+ *  CurrencyValidator class correctly validates formatted and unformatted
+ *  currency expressions, e.g., "$12,345.00" and "12345".
+ *  You can customize the currencySymbol, alignSymbol,
+ *  thousandsSeparator, and decimalSeparator
+ *  properties for internationalization.
+ *
+ *  @mxml
+ *
+ *
The <mx:CurrencyValidator> tag
+ *  inherits all of the tag properties of its superclass,
+ *  and adds the following tag properties:

+ *
+ *

+ *  <mx:CurrencyValidator
+ *    alignSymbol="left|right|any"
+ *    allowNegative="true|false"
+ *    currencySymbol="$"
+ *    currencySymbolError="The currency symbol occurs in an invalid location."
+ *    decimalPointCountError="The decimal separator can occur only once."
+ *    decimalSeparator="."
+ *    exceedsMaxError="The amount entered is too large."
+ *    invalidCharError="The input contains invalid characters."
+ *    invalidFormatCharsError="One of the formatting parameters is invalid."
+ *    lowerThanMinError="The amount entered is too small."
+ *    maxValue="NaN"
+ *    minValue="NaN"
+ *    negativeError="The amount may not be negative."
+ *    precision="2"
+ *    precisionError="The amount entered has too many digits beyond the decimal point."
+ *    separationError="The thousands separator must be followed by three digits."
+ *    thousandsSeparator=","
+ *  />
+ *

+ *
+ *  @see mx.validators.CurrencyValidatorAlignSymbol
+ *
+ *  @includeExample examples/CurrencyValidatorExample.mxml
+ */
+public class CurrencyValidator extends Validator
+{
+	include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private
+	 *  Formatting characters for negative values.
+	 */
+	private static const NEGATIVE_FORMATTING_CHARS:String = "-()";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  Convenience method for calling a validator.
+	 *  Each of the standard Flex validators has a similar convenience method.
+	 *
+     *  @param validator The CurrencyValidator instance.
+	 *
+	 *  @param value The object to validate.
+	 *
+	 *  @param baseField Text representation of the subfield
+	 *  specified in the value parameter.
+	 *  For example, if the value parameter specifies value.currency,
+	 *  the baseField value is "currency".
+	 *
+	 *  @return An Array of ValidationResult objects, with one ValidationResult
+	 *  object for each field examined by the validator.
+	 *
+	 *  @see mx.validators.ValidationResult
+     */
+    public static function validateCurrency(validator:CurrencyValidator,
+											value:Object,
+											baseField:String):Array
+    {
+		var results:Array = [];
+
+		// Resource-backed properties of the validator.
+		var alignSymbol:String = validator.alignSymbol;
+		var allowNegative:Boolean = validator.allowNegative;
+		var currencySymbol:String = validator.currencySymbol;
+		var decimalSeparator:String = validator.decimalSeparator;
+		var maxValue:Number = Number(validator.maxValue);
+		var minValue:Number = Number(validator.minValue);
+		var precision:int = int(validator.precision);
+		var thousandsSeparator:String = validator.thousandsSeparator;
+
+        var input:String = String(value);
+        var len:int = input.length;
+
+		var isNegative:Boolean = false;
+
+		var i:int;
+		var c:String;
+
+        // Make sure the formatting character parameters are unique,
+		// are not digits or negative formatting characters,
+		// and that the separators are one character.
+        var invalidFormChars:String = DECIMAL_DIGITS + NEGATIVE_FORMATTING_CHARS;
+
+        if (currencySymbol == thousandsSeparator ||
+            currencySymbol == decimalSeparator ||
+            decimalSeparator == thousandsSeparator ||
+            invalidFormChars.indexOf(currencySymbol) != -1 ||
+            invalidFormChars.indexOf(decimalSeparator) != -1 ||
+            invalidFormChars.indexOf(thousandsSeparator) != -1 ||
+            decimalSeparator.length != 1 ||
+            thousandsSeparator.length != 1)
+        {
+			results.push(new ValidationResult(
+				true, baseField, "invalidFormatChar",
+				validator.invalidFormatCharsError));
+			return results;
+        }
+
+        // Check for invalid characters in input.
+        var validChars:String =
+        	DECIMAL_DIGITS + NEGATIVE_FORMATTING_CHARS +
+			currencySymbol + decimalSeparator + thousandsSeparator;
+        for (i = 0; i < len; i++)
+        {
+            c = input.charAt(i);
+
+            if (validChars.indexOf(c) == -1)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+            }
+        }
+
+        // Check if the input is negative.
+        if (input.charAt(0) == "-")
+        {
+            // Check if negative input is allowed.
+            if (!allowNegative)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "negative",
+					validator.negativeError));
+				return results;
+            }
+
+            // Strip off the negative formatting and update some variables.
+            input = input.substring(1);
+            len--;
+            isNegative = true;
+        }
+
+        else if (input.charAt(0) == "(")
+        {
+            // Make sure the last character is a closed parenthesis.
+            if (input.charAt(len - 1) != ")")
+            {
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+            }
+
+            // Check if negative input is allowed.
+            if (!allowNegative)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "negative",
+					validator.negativeError));
+				return results;
+            }
+
+            // Strip off the negative formatting and update some variables.
+            input = input.substring(1,len-2);
+            len -= 2;
+            isNegative = true;
+        }
+
+        // Find the currency symbol if it exists,
+		// then make sure that it's in the right place
+		// and that there is only one.
+        if ((input.charAt(0) == currencySymbol &&
+			 alignSymbol == CurrencyValidatorAlignSymbol.RIGHT) ||
+            (input.charAt(len - 1) == currencySymbol &&
+			 alignSymbol == CurrencyValidatorAlignSymbol.LEFT) ||
+            (len > 2 &&
+			 input.substring(1, len - 1).indexOf(currencySymbol) != -1) ||
+            (input.indexOf(currencySymbol) !=
+			 input.lastIndexOf(currencySymbol)))
+        {
+            results.push(new ValidationResult(
+				true, baseField, "currencySymbol",
+				validator.currencySymbolError));
+			return results;
+        }
+
+        // Now that we know it's in the right place,
+		// strip off the currency symbol if it exists.
+        var currencySymbolIndex:int = input.indexOf(currencySymbol);
+        if (currencySymbolIndex != -1)
+        {
+            if (currencySymbolIndex) // if it's at the end
+                input = input.substring(0, len - 1);
+            else // it's at the beginning
+                input = input.substring(1);
+            len--;
+        }
+
+        // Make sure there is only one decimal point.
+        if (input.indexOf(decimalSeparator) !=
+			input.lastIndexOf(decimalSeparator))
+        {
+            results.push(new ValidationResult(
+				true, baseField, "decimalPointCount",
+				validator.decimalPointCountError));
+			return results;
+        }
+
+        // Make sure that every character after the decimal point
+		// is a digit and that the precision is not exceeded.
+        var decimalSeparatorIndex:int = input.indexOf(decimalSeparator);
+        var numDigitsAfterDecimal:int = 0;
+
+        // If there is no decimal separator, act like there is one at the end.
+        if (decimalSeparatorIndex == -1)
+          decimalSeparatorIndex = len;
+
+        for (i = decimalSeparatorIndex + 1; i < len; i++)
+        {
+			if (DECIMAL_DIGITS.indexOf(input.charAt(i)) == -1)
+			{
+				results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+			}
+
+			++numDigitsAfterDecimal;
+
+			// Make sure precision is not exceeded.
+			if (precision != -1 && numDigitsAfterDecimal > precision)
+			{
+				results.push(new ValidationResult(
+					true, baseField, "precision",
+					validator.precisionError));
+				return results;
+			}
+		}
+
+        // Make sure the input begins with a digit or a decimal point.
+        if (DECIMAL_DIGITS.indexOf(input.charAt(0)) == -1 &&
+			input.charAt(0) != decimalSeparator)
+        {
+            results.push(new ValidationResult(
+				true, baseField, "invalidChar",
+				validator.invalidCharError));
+			return results;
+        }
+
+        // Make sure that every character before the decimal point
+		// is a digit or is a thousands separator.
+        // If it's a thousands separator, make sure it's followed
+		// by three consecutive digits, and then make sure the next character
+		// is valid (i.e., either thousands separator, decimal separator,
+		// or nothing).
+        var validGroupEnder:String = thousandsSeparator + decimalSeparator;
+        for (i = 1; i < decimalSeparatorIndex; i++)
+        {
+            c = input.charAt(i);
+
+            if (c == thousandsSeparator)
+            {
+                if (input.substring(i + 1, i + 4).length < 3 ||
+                    DECIMAL_DIGITS.indexOf(input.charAt(i + 1)) == -1 ||
+                    DECIMAL_DIGITS.indexOf(input.charAt(i + 2)) == -1 ||
+                    DECIMAL_DIGITS.indexOf(input.charAt(i + 3)) == -1 ||
+                    validGroupEnder.indexOf(input.charAt(i + 4)) == -1)
+                {
+                	results.push(new ValidationResult(
+						true, baseField, "separation",
+						validator.separationError));
+					return results;
+                }
+            }
+            else if (DECIMAL_DIGITS.indexOf(c) == -1)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "invalidChar",
+					validator.invalidCharError));
+				return results;
+            }
+        }
+
+        // Make sure the input is within the specified range.
+        if (!isNaN(minValue) || !isNaN(maxValue))
+        {
+            // First strip off the thousands separators.
+            for (i = 0; i < decimalSeparatorIndex; i++)
+            {
+                if (input.charAt(i) == thousandsSeparator)
+                {
+                    var left:String = input.substring(0, i);
+                    var right:String = input.substring(i + 1);
+                    input = left + right;
+                }
+            }
+
+            // Check bounds
+
+			var x:Number = Number(input);
+
+			if (isNegative)
+                x = -x;
+
+			if (!isNaN(minValue) && x < minValue)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "lowerThanMin",
+					validator.lowerThanMinError));
+				return results;
+            }
+
+			if (!isNaN(maxValue) && x > maxValue)
+            {
+                results.push(new ValidationResult(
+					true, baseField, "exceedsMax",
+					validator.exceedsMaxError));
+				return results;
+            }
+        }
+
+        return results;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+    public function CurrencyValidator()
+    {
+		super();
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  alignSymbol
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the alignSymbol property.
+	 */
+	private var _alignSymbol:String;
+
+    /**
+	 *  @private
+	 */
+	private var alignSymbolOverride:String;
+
+	[Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Specifies the alignment of the currencySymbol
+	 *  relative to the rest of the expression.
+	 *  Acceptable values in ActionScript are CurrencyValidatorAlignSymbol.LEFT,
+	 *  CurrencyValidatorAlignSymbol.RIGHT, and
+	 *  CurrencyValidatorAlignSymbol.ANY.
+	 *  Acceptable values in MXML are "left",
+	 *  "right", and
+	 *  "any".
+	 *
+	 *  @default CurrencyValidatorAlignSymbol.LEFT
+     *
+     *  @see mx.validators.CurrencyValidatorAlignSymbol
+     */
+	public function get alignSymbol():String
+	{
+		return _alignSymbol;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set alignSymbol(value:String):void
+	{
+		alignSymbolOverride = value;
+
+		_alignSymbol = value != null ?
+					   value :
+					   resourceManager.getString(
+					       "SharedResources", "alignSymbol");
+	}
+
+	//----------------------------------
+	//  allowNegative
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the allowNegative property.
+	 */
+	private var _allowNegative:Object;
+
+    /**
+	 *  @private
+	 */
+	private var allowNegativeOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Specifies whether negative numbers are permitted.
+	 *  Can be true or false.
+	 *
+	 *  @default true
+     */
+	public function get allowNegative():Object
+	{
+		return _allowNegative;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set allowNegative(value:Object):void
+	{
+		allowNegativeOverride = value;
+
+		_allowNegative = value != null ?
+						 Boolean(value) :
+						 resourceManager.getBoolean(
+						     "validators", "allowNegative");
+	}
+
+	//----------------------------------
+	//  currencySymbol
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the currencySymbol property.
+	 */
+	private var _currencySymbol:String;
+
+    /**
+	 *  @private
+	 */
+	private var currencySymbolOverride:String;
+
+	[Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The single-character String used to specify the currency symbol,
+     *  such as "$" or "£".
+	 *  Cannot be a digit and must be distinct from the
+     *  thousandsSeparator and the decimalSeparator.
+     *
+	 *  @default "$"
+     */
+	public function get currencySymbol():String
+	{
+		return _currencySymbol;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set currencySymbol(value:String):void
+	{
+		currencySymbolOverride = value;
+
+		_currencySymbol = value != null ?
+						  value :
+						  resourceManager.getString(
+						      "SharedResources", "currencySymbol");
+	}
+
+	//----------------------------------
+	//  decimalSeparator
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the decimalSeparator property.
+	 */
+	private var _decimalSeparator:String;
+
+    /**
+	 *  @private
+	 */
+	private var decimalSeparatorOverride:String;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The character used to separate the whole
+	 *  from the fractional part of the number.
+	 *  Cannot be a digit and must be distinct from the
+     *  currencySymbol and the thousandsSeparator.
+	 *
+	 *  @default "."
+     */
+	public function get decimalSeparator():String
+	{
+		return _decimalSeparator;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set decimalSeparator(value:String):void
+	{
+		decimalSeparatorOverride = value;
+
+		_decimalSeparator = value != null ?
+							value :
+							resourceManager.getString(
+								"validators", "decimalSeparator");
+	}
+
+	//----------------------------------
+	//  maxValue
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the maxValue property.
+	 */
+	private var _maxValue:Object;
+
+    /**
+	 *  @private
+	 */
+	private var maxValueOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Maximum value for a valid number.
+	 *  A value of NaN means it is ignored.
+	 *
+	 *  @default NaN
+     */
+	public function get maxValue():Object
+	{
+		return _maxValue;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set maxValue(value:Object):void
+	{
+		maxValueOverride = value;
+
+		_maxValue = value != null ?
+					Number(value) :
+					resourceManager.getNumber(
+						"validators", "maxValue");
+	}
+
+	//----------------------------------
+	//  minValue
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the minValue property.
+	 */
+	private var _minValue:Object;
+
+    /**
+	 *  @private
+	 */
+	private var minValueOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  Minimum value for a valid number.
+	 *  A value of NaN means it is ignored.
+	 *
+	 *  @default NaN
+     */
+	public function get minValue():Object
+	{
+		return _minValue;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set minValue(value:Object):void
+	{
+		minValueOverride = value;
+
+		_minValue = value != null ?
+					Number(value) :
+					resourceManager.getNumber(
+						"validators", "minValue");
+	}
+
+	//----------------------------------
+	//  precision
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the precision property.
+	 */
+	private var _precision:Object;
+
+    /**
+	 *  @private
+	 */
+	private var precisionOverride:Object;
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    /**
+     *  The maximum number of digits allowed to follow the decimal point.
+	 *  Can be any non-negative integer.
+	 *  Note: Setting to 0
+     *  has the same effect as setting NumberValidator.domain
+	 *  to int.
+	 *	Setting it to -1, means it is ignored.
+	 *
+	 *  @default 2
+     */
+	public function get precision():Object
+	{
+		return _precision;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set precision(value:Object):void
+	{
+		precisionOverride = value;
+
+		_precision = value != null ?
+					 int(value) :
+					 resourceManager.getInt(
+					     "validators", "currencyValidatorPrecision");
+	}
+
+	//----------------------------------
+	//  thousandsSeparator
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the thousandsSeparator property.
+	 */
+	private var _thousandsSeparator:String;
+
+    /**
+	 *  @private
+	 */
+	private var thousandsSeparatorOverride:String;
+
+    [Inspectable(category="General", defaultValue=",")]
+
+    /**
+     *  The character used to separate thousands.
+	 *  Cannot be a digit and must be distinct from the
+     *  currencySymbol and the decimalSeparator.
+	 *
+	 *  @default ","
+     */
+	public function get thousandsSeparator():String
+	{
+		return _thousandsSeparator;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set thousandsSeparator(value:String):void
+	{
+		thousandsSeparatorOverride = value;
+
+		_thousandsSeparator = value != null ?
+							  value :
+							  resourceManager.getString(
+							      "validators", "thousandsSeparator");
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties: Errors
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  currencySymbolError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the currencySymbolError property.
+	 */
+	private var _currencySymbolError:String;
+
+    /**
+	 *  @private
+	 */
+	private var currencySymbolErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the currency symbol, defined by currencySymbol,
+     *  is in the wrong location.
+	 *
+	 *  @default "The currency symbol occurs in an invalid location."
+     */
+	public function get currencySymbolError():String
+	{
+		return _currencySymbolError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set currencySymbolError(value:String):void
+	{
+		currencySymbolErrorOverride = value;
+
+		_currencySymbolError = value != null ?
+							   value :
+							   resourceManager.getString(
+							       "validators", "currencySymbolError");
+	}
+
+	//----------------------------------
+	//  decimalPointCountError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the decimalPointCountError property.
+	 */
+	private var _decimalPointCountError:String;
+
+    /**
+	 *  @private
+	 */
+	private var decimalPointCountErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the decimal separator character occurs more than once.
+	 *
+	 *  @default "The decimal separator can only occur once."
+     */
+	public function get decimalPointCountError():String
+	{
+		return _decimalPointCountError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set decimalPointCountError(value:String):void
+	{
+		decimalPointCountErrorOverride = value;
+
+		_decimalPointCountError = value != null ?
+								  value :
+								  resourceManager.getString(
+								      "validators", "decimalPointCountError");
+	}
+
+	//----------------------------------
+	//  exceedsMaxError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the exceedsMaxError property.
+	 */
+	private var _exceedsMaxError:String;
+
+    /**
+	 *  @private
+	 */
+	private var exceedsMaxErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is greater than maxValue.
+	 *
+	 *  @default "The amount entered is too large."
+     */
+	public function get exceedsMaxError():String
+	{
+		return _exceedsMaxError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set exceedsMaxError(value:String):void
+	{
+		exceedsMaxErrorOverride = value;
+
+		_exceedsMaxError = value != null ?
+						   value :
+						   resourceManager.getString(
+						       "validators", "exceedsMaxErrorCV");
+	}
+
+	//----------------------------------
+	//  invalidCharError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the invalidCharError property.
+	 */
+	private var _invalidCharError:String;
+
+    /**
+	 *  @private
+	 */
+	private var invalidCharErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the currency contains invalid characters.
+	 *
+	 *  @default "The input contains invalid characters."
+     */
+	public function get invalidCharError():String
+	{
+		return _invalidCharError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set invalidCharError(value:String):void
+	{
+		invalidCharErrorOverride = value;
+
+		_invalidCharError = value != null ?
+							value :
+							resourceManager.getString(
+								"validators", "invalidCharError");
+	}
+
+	//----------------------------------
+	//  invalidFormatCharsError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the invalidFormatCharsError property.
+	 */
+	private var _invalidFormatCharsError:String;
+
+    /**
+	 *  @private
+	 */
+	private var invalidFormatCharsErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value contains an invalid formatting character.
+	 *
+	 *  @default "One of the formatting parameters is invalid."
+     */
+	public function get invalidFormatCharsError():String
+	{
+		return _invalidFormatCharsError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set invalidFormatCharsError(value:String):void
+	{
+		invalidFormatCharsErrorOverride = value;
+
+		_invalidFormatCharsError = value != null ?
+								   value :
+								   resourceManager.getString(
+								       "validators", "invalidFormatCharsError");
+	}
+
+	//----------------------------------
+	//  lowerThanMinError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the lowerThanMinError property.
+	 */
+	private var _lowerThanMinError:String;
+
+    /**
+	 *  @private
+	 */
+	private var lowerThanMinErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is less than minValue.
+	 *
+	 *  @default "The amount entered is too small."
+     */
+	public function get lowerThanMinError():String
+	{
+		return _lowerThanMinError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set lowerThanMinError(value:String):void
+	{
+		lowerThanMinErrorOverride = value;
+
+		_lowerThanMinError = value != null ?
+							 value :
+							 resourceManager.getString(
+							     "validators", "lowerThanMinError");
+	}
+
+	//----------------------------------
+	//  negativeError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the negativeError property.
+	 */
+	private var _negativeError:String;
+
+    /**
+	 *  @private
+	 */
+	private var negativeErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value is negative and
+     *  the allowNegative property is false.
+	 *
+	 *  @default "The amount may not be negative."
+     */
+	public function get negativeError():String
+	{
+		return _negativeError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set negativeError(value:String):void
+	{
+		negativeErrorOverride = value;
+
+		_negativeError = value != null ?
+						 value :
+						 resourceManager.getString(
+						     "validators", "negativeError");
+	}
+
+	//----------------------------------
+	//  precisionError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the precisionError property.
+	 */
+	private var _precisionError:String;
+
+    /**
+	 *  @private
+	 */
+	private var precisionErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the value has a precision that exceeds the value
+     *  defined by the precision property.
+	 *
+	 *  @default "The amount entered has too many digits beyond
+	 *  the decimal point."
+     */
+	public function get precisionError():String
+	{
+		return _precisionError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set precisionError(value:String):void
+	{
+		precisionErrorOverride = value;
+
+		_precisionError = value != null ?
+						  value :
+						  resourceManager.getString(
+						      "validators", "precisionError");
+	}
+
+	//----------------------------------
+	//  separationError
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the separationError property.
+	 */
+	private var _separationError:String;
+
+    /**
+	 *  @private
+	 */
+	private var separationErrorOverride:String;
+
+    [Inspectable(category="Errors", defaultValue="null")]
+
+    /**
+     *  Error message when the thousands separator is incorrectly placed.
+	 *
+	 *  @default "The thousands separator must be followed by three digits."
+     */
+	public function get separationError():String
+	{
+		return _separationError;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set separationError(value:String):void
+	{
+		separationErrorOverride = value;
+
+		_separationError = value != null ?
+						   value :
+						   resourceManager.getString(
+						       "validators", "separationError");
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private
+     */
+	override protected function resourcesChanged():void
+	{
+		super.resourcesChanged();
+
+		alignSymbol = alignSymbolOverride;
+		allowNegative = allowNegativeOverride;
+		currencySymbol = currencySymbolOverride;
+		decimalSeparator = decimalSeparatorOverride;
+		maxValue = maxValueOverride;
+		minValue = minValueOverride;
+		precision = precisionOverride;
+		thousandsSeparator = thousandsSeparatorOverride;
+
+		currencySymbolError = currencySymbolErrorOverride;
+		decimalPointCountError = decimalPointCountErrorOverride;
+		exceedsMaxError = exceedsMaxErrorOverride;
+		invalidCharError = invalidCharErrorOverride;
+		invalidFormatCharsError = invalidFormatCharsErrorOverride;
+		lowerThanMinError = lowerThanMinErrorOverride;
+		negativeError = negativeErrorOverride;
+		precisionError = precisionErrorOverride;
+		separationError = separationErrorOverride;
+	}
+
+    /**
+     *  Override of the base class doValidation() method
+     *  to validate a currency expression.
+     *
+	 *
You do not call this method directly;
+	 *  Flex calls it as part of performing a validation.
+	 *  If you create a custom Validator class, you must implement this method.

+	 *
+     *  @param value Object to validate.
+     *
+	 *  @return An Array of ValidationResult objects, with one ValidationResult
+	 *  object for each field examined by the validator.
+     */
+    override protected function doValidation(value:Object):Array
+    {
+        var results:Array = super.doValidation(value);
+
+		// Return if there are errors
+		// or if the required property is set to false and length is 0.
+		var val:String = value ? String(value) : "";
+		if (results.length > 0 || ((val.length == 0) && !required))
+			return results;
+		else
+		    return CurrencyValidator.validateCurrency(this, value, null);
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17198
Author:   jszeto@adobe.com
Date:     2010-08-05T04:16:36.133208Z

Log Message:
-----------
Mobile Button Skin

Added icon support:
- Added iconClass and labelPlacement styles to Button

Reworked ButtonSkin.as:
- Switched from creating TextFields to using createInFontContext to create UITextFields
- Removed all of the TextFormat and style code. UITextField uses the style protochain to get the proper text styles.
- Replaced measure with the measure code from mx Button.
- Replaced updateDisplayList with the layoutContents code from mx Button.
- Added states in constructor
- Fixed up the formatting to follow the framework conventions
- Added copyright and asdoc comments

Temporarily added ButtonLabelPlacement into the mobilecomponents swc. I more permanent solution is to move ButtonLabelPlacement.as from the mx to frameworks rsl.

This should fix the text style and sizing issues. LabelPlacement supports left, right, top and bottom.

The button icon support API is not final.

QE notes: This change along with revision 17195 will require new mobile Button mustella baselines
Doc notes: n/a
Bugs:
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ButtonLabelPlacement.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mx/src/mx/controls/Button.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/MobileComponentsClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as
@@ -1,219 +1,536 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2008 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
 package spark.skins.mobile
 {
-
-	import flash.display.DisplayObject;
-	import flash.display.GradientType;
-	import flash.events.Event;
-	import flash.events.EventDispatcher;
-	import flash.geom.Matrix;
-	import flash.text.TextField;
-	import flash.text.TextFormat;
-
-	import mx.core.UIComponent;
-	import mx.utils.ColorUtil;
-
-	import spark.components.Button;
-
-	public class ButtonSkin extends UIComponent
-	{
-		public function ButtonSkin()
-		{
-			super();
-		}
-
-		public var hostComponent:Button;
-
-		//////////////////////////////////////////
-		// Properties
-		//////////////////////////////////////////
-
-		// currentState
-		private var _currentState:String;
-
-		override public function get currentState():String
-		{
-			return _currentState;
-		}
-
-		override public function set currentState(value:String):void
-		{
-			if (value == _currentState)
-				return;
-
-			_currentState = value;
-
-			applyFXG();
-		}
-
-		//////////////////////////////////////////
-		// Methods
-		//////////////////////////////////////////
-
-		override protected function createChildren():void
-		{
-			// Set up text fields only if we have a hostComponent
-			if(hostComponent != null) {
-				var tf:TextFormat = new TextFormat;
-
-				textField = new TextField();
-				textFieldShadow = new TextField();
-
-				tf = setTextFormat(tf);
-
-				textField.defaultTextFormat = tf;
-				tf.color = 0x000000;
-				textFieldShadow.defaultTextFormat = tf;
-				textFieldShadow.alpha = .20;
-
-				addChild(textField);
-				addChild(textFieldShadow);
-
-				hostComponent.addEventListener("contentChange", handleContentChange);
-			}
-
-			applyFXG();
-		}
-
-		protected function handleContentChange(event:Event):void {
-			updateLabel();
-		}
-
-		private function updateLabel():void {
-			if(hostComponent != null) {
-				textField.text = hostComponent.label;
-				textFieldShadow.text = hostComponent.label;
-				invalidateSize();
-			}
-		}
-
-		override public function styleChanged(styleProp:String):void {
-			// TODO: Refactor to check whether styleProp is one of three following value types and update
-			// the styles accordingly:
-			// 1) Individual style name (e.g. "fontSize"). 2) "styleName". 3) null.
-			// If 1) reset only individual style. If 2) or 3), reset all styles
-
-			// Only deal with text if a hostComponent exists and text fields are not empty
-			if(hostComponent != null && textField != null && textFieldShadow != null) {
-				var tf:TextFormat = textField.defaultTextFormat;
-
-				tf = setTextFormat(tf);
-
-				textField.setTextFormat(tf);
-				tf.color = 0x000000;
-				textFieldShadow.setTextFormat(tf);
-				textFieldShadow.alpha = .20;
-			}
-			super.styleChanged(styleProp);
-		}
-
-		private function setTextFormat(tf:TextFormat):TextFormat {
-			tf.align = "center";
-			tf.color = getStyle("color");
-			tf.font = getStyle("fontFamily");
-			tf.size = getStyle("fontSize");
-			tf.bold = getStyle("fontWeight") == "bold";
-
-			return tf;
-		}
-
-		private function applyFXG():void {
-			if (_currentState == "down") {
-				if(bgImg != null) {
-					removeChild(bgImg);
-				}
-				bgImg = new Button_bg_down();
-			}
-			else {
-				if (!(bgImg is Button_bg_up)) {
-					if(bgImg != null) {
-						removeChild(bgImg);
-					}
-					bgImg = new Button_bg_up();
-				}
-			}
-
-			if(bgImg != null) {
-				addChild(bgImg);
-				invalidateDisplayList();
-			}
-
-			if(_currentState == "disabled") {
-				alpha = 0.5;
-			}
-			else
-				alpha = 1;
-		}
-
-		override protected function commitProperties():void
-		{
-			updateLabel();
-		}
-
-		override protected function measure():void
-		{
-			// TODO: Minimum sizes should come from the embedded graphics.
-			measuredWidth = textField.textWidth + 20;
-
-			// graphic height
-			measuredHeight = 42;
-		}
-
-		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-		{
-			graphics.clear();
-
-			if(bgImg != null) {
-				bgImg.x = bgImg.y = 0.5;
-				bgImg.width = unscaledWidth;
-				bgImg.height = unscaledHeight;
-			}
-
-			// Set Text/Text Shadow position and size
-			if(textField != null) {
-				// Center the label
-				textField.width = unscaledWidth;
-				textField.height = textField.textHeight + 4;
-				textField.y = Math.round((unscaledHeight - textField.height) / 2);
-
-				// Center the label shadow
-				textFieldShadow.width = unscaledWidth;
-				textFieldShadow.height = textFieldShadow.textHeight + 4;
-				textFieldShadow.y = textField.y + 1;
-
-				// Put the label on top
-				setChildIndex(textField, numChildren - 1);
-
-				// set label shadow behind main label
-				setChildIndex(textFieldShadow, numChildren - 2);
-			}
-
-			// Draw the gradient background
-			matrix.createGradientBox(unscaledWidth - 1, unscaledHeight - 2, Math.PI / 2, 0, 0);
-			var chromeColor:uint = getStyle("chromeColor");
-			colors[0] = ColorUtil.adjustBrightness2(chromeColor, 20);
-			colors[1] = chromeColor;
-			colors[2] = ColorUtil.adjustBrightness2(chromeColor, -20);
-
-			graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
-
-			// Draw the background rectangle within the border, so the corners of the rect don't
-			// spill over into the rounded corners of the Button
-			graphics.drawRect(1, 1, unscaledWidth - 1, unscaledHeight - 2);
-			graphics.endFill();
-
-			super.updateDisplayList(unscaledWidth, unscaledHeight);
-		}
-
-		//////////////////////////////////////////
-		// Internals
-		//////////////////////////////////////////
-
-		private var textField:TextField;
-		private var textFieldShadow:TextField;
-		private var bgImg:DisplayObject;
-		private static var matrix:Matrix = new Matrix();
-		private static var alphas:Array = [1, 1, 1];
-		private static var ratios:Array = [0, 127.5, 255];
-		private static var colors:Array = [];
-	}
+
+import flash.display.DisplayObject;
+import flash.display.GradientType;
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import flash.geom.Matrix;
+import flash.text.TextField;
+import flash.text.TextFormat;
+import flash.text.TextFormatAlign;
+import flash.text.TextLineMetrics;
+
+import mx.core.IUITextField;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.core.mx_internal;
+import mx.states.SetProperty;
+import mx.states.State;
+import mx.utils.ColorUtil;
+
+import spark.components.Button;
+import spark.components.supportClasses.ButtonLabelPlacement;
+
+use namespace mx_internal;
+
+/*
+    ISSUES:
+    - should we support textAlign
+    - labelPlacement a style?
+    - iconClass a style?
+    - need a downIconClass style?
+    - should the label be UITextField or another text class?
+
+*/
+/**
+ *  Actionscript based skin for mobile applications. The skin supports iconClass and labelPlacement. It uses
+ *  a couple of FXG classes to implement the vector drawing.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+public class ButtonSkin extends UIComponent
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    public function ButtonSkin()
+    {
+        super();
+
+        states = [
+            new State({name:"up"}),
+            new State({name:"over"}),
+            new State({name:"down"}),
+            new State({name:"disabled",
+                overrides:[new SetProperty(this, "alpha", 0.5)]})
+        ];
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    private var textField:IUITextField;
+    private var textFieldShadow:IUITextField;
+    private var bgImg:DisplayObject;
+
+    private static var matrix:Matrix = new Matrix();
+
+    // TODO (jszeto) move to const values
+    // TODO (jszeto) add comments
+    private static var alphas:Array = [1, 1, 1];
+    private static var ratios:Array = [0, 127.5, 255];
+    // TODO (jszeto) move to local vars
+    private static var colors:Array = [];
+
+    // Holds the icon
+    private var iconDisplay:DisplayObject;
+
+    // TODO (jszeto) Either static consts or styles
+    private var gap:int = 10;
+    private var paddingLeft:int = 10;
+    private var paddingRight:int = 10;
+    private var paddingTop:int = 10;
+    private var paddingBottom:int = 10;
+
+    private static var TEXT_WIDTH_PADDING:Number = UITextField.TEXT_WIDTH_PADDING + 1;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * @copy spark.skins.spark.ApplicationSkin#hostComponent
+     */
+    public var hostComponent:Button; // SkinnableComponent will popuplate
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  currentState
+    //----------------------------------
+
+    override public function set currentState(value:String):void
+    {
+        if (value == currentState)
+            return;
+
+        super.currentState = value;
+
+        // TODO (jszeto) maybe call invalidateDisplayList instead of applyFXG
+        applyFXG();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+        // Set up text fields only if we have a hostComponent
+        // TODO (jszeto) Do we need to check for this?
+        if (hostComponent != null)
+        {
+            textField = IUITextField(createInFontContext(UITextField));
+            textFieldShadow = IUITextField(createInFontContext(UITextField));
+
+            // TODO (jszeto) Ask XD if shadow color is dependant upon text color
+            textFieldShadow.setColor(0x000000);
+            textFieldShadow.alpha = .20;
+
+            addChild(UITextField(textFieldShadow));
+            addChild(UITextField(textField));
+
+            hostComponent.addEventListener("contentChange", hostComponent_contentChangeHandler);
+        }
+
+        var iconClass:Class = getStyle("iconClass");
+
+        if (iconClass)
+        {
+            // Should be a bitmap
+            iconDisplay = new iconClass();
+            addChild(iconDisplay);
+        }
+
+        applyFXG();
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void {
+        // TODO: Refactor to check whether styleProp is one of three following value types and update
+        // the styles accordingly:
+        // 1) Individual style name (e.g. "fontSize"). 2) "styleName". 3) null.
+        // If 1) reset only individual style. If 2) or 3), reset all styles
+
+        // Only deal with text if a hostComponent exists and text fields are not empty
+        /*if(hostComponent != null && textField != null && textFieldShadow != null) {
+            var tf:TextFormat = textField.defaultTextFormat;
+
+            tf = setTextFormat(tf);
+
+            //textField.setTextFormat(tf);
+            tf.color = 0x000000;
+            textFieldShadow.setTextFormat(tf);
+            textFieldShadow.alpha = .20;
+        }*/
+
+        // TODO Reapply the color to the textFieldShadow
+        // TODO (jszeto) Add check for change to iconClass
+
+        super.styleChanged(styleProp);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        // TODO (jszeto) is this necessary? Won't the contentChange handler take care of this?
+        updateLabel();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        var labelPlacement:String = getStyle("labelPlacement");
+        if (labelPlacement == null)
+            labelPlacement = ButtonLabelPlacement.RIGHT;
+
+        var textWidth:Number = 0;
+        var textHeight:Number = 0;
+        var lineMetrics:TextLineMetrics;
+
+        if (hostComponent && hostComponent.label != "")
+        {
+            lineMetrics = measureText(hostComponent.label);
+            textWidth = lineMetrics.width + TEXT_WIDTH_PADDING;
+            textHeight = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+        else
+        {
+            lineMetrics = measureText("Wj");
+            textWidth = lineMetrics.width + TEXT_WIDTH_PADDING;
+            textHeight = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+
+        var iconWidth:Number = iconDisplay ? iconDisplay.width : 0;
+        var iconHeight:Number = iconDisplay ? iconDisplay.height : 0;
+        var w:Number = 0;
+        var h:Number = 0;
+
+        if (labelPlacement == ButtonLabelPlacement.LEFT ||
+            labelPlacement == ButtonLabelPlacement.RIGHT)
+        {
+            w = textWidth + iconWidth;
+            if (textWidth && iconWidth)
+                w += gap; //getStyle("horizontalGap");
+            h = Math.max(textHeight, iconHeight);
+        }
+        else
+        {
+            w = Math.max(textWidth, iconWidth);
+            h = textHeight + iconHeight;
+            if (textHeight && iconHeight)
+                h += gap; // getStyle("verticalGap");
+        }
+
+        // Add padding. !!!Need a hack here to only add padding if we don't
+        // have text or icon. This is required to make small buttons (like scroll
+        // arrows and numeric stepper buttons) look correct.
+        if (textWidth || iconWidth)
+        {
+            w += paddingLeft + paddingRight; //getStyle("paddingLeft") + getStyle("paddingRight");
+            h += paddingTop + paddingBottom; //getStyle("paddingTop") + getStyle("paddingBottom");
+        }
+
+        measuredMinWidth = measuredWidth = w;
+        measuredMinHeight = measuredHeight = h;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        graphics.clear();
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var labelWidth:Number = 0;
+        var labelHeight:Number = 0;
+
+        var labelX:Number = 0;
+        var labelY:Number = 0;
+
+        var iconWidth:Number = 0;
+        var iconHeight:Number = 0;
+
+        var iconX:Number = 0;
+        var iconY:Number = 0;
+
+        var horizontalGap:Number = 0;
+        var verticalGap:Number = 0;
+
+        var labelPlacement:String = getStyle("labelPlacement");
+        if (labelPlacement == null)
+            labelPlacement = ButtonLabelPlacement.RIGHT;
+
+        var textWidth:Number = 0;
+        var textHeight:Number = 0;
+
+        var lineMetrics:TextLineMetrics;
+
+        // Size the FXG background
+        if (bgImg != null)
+        {
+            // TODO (jszeto) Figure out why this is .5 Should it be 0?
+            bgImg.x = bgImg.y = 0.5;
+            bgImg.width = unscaledWidth;
+            bgImg.height = unscaledHeight;
+        }
+
+        // Draw the gradient background
+        matrix.createGradientBox(unscaledWidth - 1, unscaledHeight - 2, Math.PI / 2, 0, 0);
+        var chromeColor:uint = getStyle("chromeColor");
+        colors[0] = ColorUtil.adjustBrightness2(chromeColor, 20);
+        colors[1] = chromeColor;
+        colors[2] = ColorUtil.adjustBrightness2(chromeColor, -20);
+
+        graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
+
+        // Draw the background rectangle within the border, so the corners of the rect don't
+        // spill over into the rounded corners of the Button
+        graphics.drawRect(1, 1, unscaledWidth - 1, unscaledHeight - 2);
+        graphics.endFill();
+
+        if (hostComponent && hostComponent.label != "")
+        {
+            lineMetrics = measureText(hostComponent.label);
+            textWidth = lineMetrics.width + TEXT_WIDTH_PADDING;
+            textHeight = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+        else
+        {
+            lineMetrics = measureText("Wj");
+            textWidth = lineMetrics.width + TEXT_WIDTH_PADDING;
+            textHeight = lineMetrics.height + UITextField.TEXT_HEIGHT_PADDING;
+        }
+
+        var textAlign:String = "center"; // getStyle("textAlign");
+        // Map new Spark values that might be set in a selector
+        // affecting both Halo and Spark components.
+        if (textAlign == "start")
+            textAlign = TextFormatAlign.LEFT;
+        else if (textAlign == "end")
+            textAlign = TextFormatAlign.RIGHT;
+
+        var viewWidth:Number = unscaledWidth;
+        var viewHeight:Number = unscaledHeight;
+
+        if (iconDisplay)
+        {
+            iconWidth = iconDisplay.width;
+            iconHeight = iconDisplay.height;
+        }
+
+        if (labelPlacement == ButtonLabelPlacement.LEFT ||
+            labelPlacement == ButtonLabelPlacement.RIGHT)
+        {
+            horizontalGap = gap;
+
+            if (iconWidth == 0 || textWidth == 0)
+                horizontalGap = 0;
+
+            if (textWidth > 0)
+            {
+                labelWidth =
+                    Math.max(Math.min(viewWidth - iconWidth - horizontalGap -
+                        paddingLeft - paddingRight, textWidth), 0);
+            }
+            else
+            {
+                labelWidth = 0;
+            }
+            labelHeight = Math.min(viewHeight, textHeight);
+
+            if (textAlign == "left")
+            {
+                labelX += paddingLeft;
+            }
+            else if (textAlign == "right")
+            {
+                labelX += (viewWidth - labelWidth - iconWidth -
+                    horizontalGap - paddingRight);
+            }
+            else // "center" -- default value
+            {
+                labelX += ((viewWidth - labelWidth - iconWidth -
+                    horizontalGap - paddingLeft - paddingRight) / 2) + paddingLeft;
+            }
+
+            if (labelPlacement == ButtonLabelPlacement.RIGHT)
+            {
+                labelX += iconWidth + horizontalGap;
+                iconX = labelX - (iconWidth + horizontalGap);
+            }
+            else
+            {
+                iconX  = labelX + labelWidth + horizontalGap;
+            }
+
+            iconY  = ((viewHeight - iconHeight - paddingTop - paddingBottom) / 2) + paddingTop;
+            labelY = ((viewHeight - labelHeight - paddingTop - paddingBottom) / 2) + paddingTop;
+        }
+        else
+        {
+            verticalGap = gap;
+
+            if (iconHeight == 0 || !hostComponent || hostComponent.label == "")
+                verticalGap = 0;
+
+            if (textWidth > 0)
+            {
+                labelWidth = Math.max(viewWidth - paddingLeft - paddingRight, 0);
+                labelHeight =
+                    Math.min(viewHeight - iconHeight - paddingTop - paddingBottom - verticalGap, textHeight);
+            }
+            else
+            {
+                labelWidth = 0;
+                labelHeight = 0;
+            }
+
+            labelX = paddingLeft;
+
+            if (textAlign == "left")
+            {
+                iconX += paddingLeft;
+            }
+            else if (textAlign == "right")
+            {
+                iconX += Math.max(viewWidth - iconWidth - paddingRight, paddingLeft);
+            }
+            else
+            {
+                iconX += ((viewWidth - iconWidth - paddingLeft - paddingRight) / 2) + paddingLeft;
+            }
+
+            if (labelPlacement == ButtonLabelPlacement.TOP)
+            {
+                labelY += ((viewHeight - labelHeight - iconHeight -
+                    paddingTop - paddingBottom - verticalGap) / 2) + paddingTop;
+                iconY += labelY + labelHeight + verticalGap;
+            }
+            else
+            {
+                iconY += ((viewHeight - labelHeight - iconHeight -
+                    paddingTop - paddingBottom - verticalGap) / 2) + paddingTop;
+                labelY += iconY + iconHeight + verticalGap;
+            }
+        }
+
+        textField.x = Math.round(labelX);
+        textField.y = Math.round(labelY);
+        textField.height = labelHeight;
+        textField.width = labelWidth;
+
+        textFieldShadow.x = Math.round(labelX);
+        textFieldShadow.y = Math.round(labelY + 1);
+        textFieldShadow.height = labelHeight;
+        textFieldShadow.width = labelWidth;
+
+        if (iconDisplay)
+        {
+            iconDisplay.x = Math.round(iconX);
+            iconDisplay.y = Math.round(iconY);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function hostComponent_contentChangeHandler(event:Event):void
+    {
+        updateLabel();
+    }
+
+    /**
+     *  @private
+     */
+    private function updateLabel():void
+    {
+        if (hostComponent != null && textField)
+        {
+            textField.text = hostComponent.label;
+            textFieldShadow.text = hostComponent.label;
+            invalidateSize();
+        }
+    }
+
+    /**
+     *  @private
+     *  TODO (jszeto) fix up this logic
+     */
+    private function applyFXG():void
+    {
+        if (currentState == "down")
+        {
+            if (bgImg != null)
+                removeChild(bgImg);
+            bgImg = new Button_bg_down();
+        }
+        else
+        {
+            if (!(bgImg is Button_bg_up))
+            {
+                if (bgImg != null)
+                    removeChild(bgImg);
+                bgImg = new Button_bg_up();
+            }
+        }
+
+        if (bgImg != null)
+        {
+            // Put the fxg background on the bottom
+            addChildAt(bgImg, 0);
+            invalidateDisplayList();
+        }
+    }
+
+}
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 5545
Author:   jimurphy@adobe.com
Date:     2009-03-25T19:00:52.330680Z

Log Message:
-----------
1st pass of rename according to the spec http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix

Flex now requires CSS Style declarations to declare @namespace rules and disambiguate between halo and spark components using CSS 3 namespace prefixes on type selectors. At compile time, this namespace information will be used to map type names to qualified ActionScript class names. At runtime, type selectors are matched on qualified ActionScript class name (for example mx.controls.Button rather than just Button). Flex 3 applications must be compiled with -compatibility-version=3.0.0 to get unqualified CSS type selector behavior.

QE: Yes, this build may help in updating test cases to use the new namespaces and class names.
Dev: Not yet
Doc: Not yet

Modified Paths:
--------------
748 paths were modified

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

--- frameworks/projects/spark/src/spark/components/SkinnableContainer.as
+++ frameworks/projects/spark/src/spark/components/SkinnableContainer.as
@@ -9,27 +9,27 @@
 //
 ////////////////////////////////////////////////////////////////////////////////

-package mx.components
+package spark.components
 {

 import mx.collections.IList;
-import mx.components.Group;
+import spark.components.Group;
 import mx.core.mx_internal;
-import mx.components.baseClasses.FxComponent;
-import mx.components.baseClasses.FxContainerBase;
+import spark.components.supportClasses.SkinnableComponent;
+import spark.components.supportClasses.SkinnableContainerBase;
 import mx.core.ContainerCreationPolicy;
-import mx.core.IDeferredContentOwner;
+import spark.core.IDeferredContentOwner;
 import mx.core.IDeferredInstance;
 import mx.core.IFactory;
 import mx.core.IVisualElement;
 import mx.core.IVisualElementContainer;
 import mx.core.IUIComponent;
-import mx.core.IViewport;
+import spark.core.IViewport;
 import mx.events.FlexEvent;
-import mx.events.ElementExistenceEvent;
+import spark.events.ElementExistenceEvent;
 import mx.events.PropertyChangeEvent;
-import mx.layout.BasicLayout;
-import mx.layout.LayoutBase;
+import spark.layout.BasicLayout;
+import spark.layout.supportClasses.LayoutBase;
 import mx.managers.IFocusManagerContainer;
 import mx.utils.BitFlagUtil;

@@ -58,7 +58,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Event(name="elementAdd", type="mx.events.ElementExistenceEvent")]
+[Event(name="elementAdd", type="spark.events.ElementExistenceEvent")]

 /**
  *  Dispatched when a visual element is removed to the content holder.
@@ -71,7 +71,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Event(name="elementRemove", type="mx.events.ElementExistenceEvent")]
+[Event(name="elementRemove", type="spark.events.ElementExistenceEvent")]

 include "../styles/metadata/AdvancedTextLayoutFormatStyles.as"
 include "../styles/metadata/BasicTextLayoutFormatStyles.as"
@@ -128,7 +128,7 @@
 [Style(name="symbolColor", type="uint", format="Color", inherit="yes")]

-[IconFile("FxContainer.png")]
+[IconFile("SkinnableContainer.png")]

 //--------------------------------------
 //  Excluded APIs
@@ -137,17 +137,17 @@
 [DefaultProperty("mxmlContentFactory")]

 /**
- *  The FxContainer class is the base class for all skinnable components that have
+ *  The SkinnableContainer class is the base class for all skinnable components that have
  *  visual content.
  *
- *  @see FxDataContainer
+ *  @see SkinnableDataContainer
  *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-public class FxContainer extends FxContainerBase
+public class SkinnableContainer extends SkinnableContainerBase
        implements IDeferredContentOwner, IViewport, IVisualElementContainer
 {
     include "../core/Version.as";
@@ -197,7 +197,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function FxContainer()
+    public function SkinnableContainer()
     {
         super();

@@ -226,15 +226,15 @@
     /**
      *  @private
      *  Several properties are proxied to contentGroup.  However, when contentGroup
-     *  is not around, we need to store values set on FxContainer.  This object
+     *  is not around, we need to store values set on SkinnableContainer.  This object
      *  stores those values.  If contentGroup is around, the values are stored
      *  on the contentGroup directly.  However, we need to know what values
-     *  have been set by the developer on the FxContainer (versus set on
+     *  have been set by the developer on the SkinnableContainer (versus set on
      *  the contentGroup or defaults of the contentGroup) as those are values
      *  we want to carry around if the contentGroup changes (via a new skin).
      *  In order to store this info effeciently, contentGroupProperties becomes
      *  a uint to store a series of BitFlags.  These bits represent whether a
-     *  property has been explicitely set on this FxContainer.  When the
+     *  property has been explicitely set on this SkinnableContainer.  When the
      *  contentGroup is not around, contentGroupProperties is a typeless
      *  object to store these proxied properties.  When contentGroup is around,
      *  contentGroupProperties stores booleans as to whether these properties


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

--- frameworks/projects/spark/src/spark/layouts/supportClasses/Block.as
+++ frameworks/projects/spark/src/spark/layouts/supportClasses/Block.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 Adobe Systems Incorporated
-//  All Rights Reserved.
-//
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////

 package spark.layouts.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 9578
Author:   aharui@adobe.com
Date:     2009-08-25T17:23:52.967867Z

Log Message:
-----------
Found another embeddedfontcontext issue in the player.  ElementFormat.getFontMetrics() must be called in the embeddedFont's moduleFactory context.  Added a general "callInContext" API to IFLexModuleFactory.  Eventually, TLF will add a new API so they can connect up to this capability and we'll change the code one more time.

QE Notes: None
Doc Notes: New API in IFlexModuleFactory.as
Bugs: SDK-22159
Reviewer: Darrell
API Change: Yes
Is noteworthy for integration: No
tests: checkintests

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

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

--- frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
+++ frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
@@ -876,6 +876,19 @@
     //  Methods: Initialization
     //
     //--------------------------------------------------------------------------
+
+    /**
+	 *  This method is should not be called on WindowedSystemManager.  It is here
+     *  as part of the contract for IFlexModuleFactory.
+   	 */
+    public function callInContext(fn:Function, thisArg:*, argsArray:*, returns:Boolean=true):*
+    {
+        if (returns)
+            return fn.apply(thisArg, argsArray);
+
+        else
+            fn.apply(thisArg, argsArray);
+    }

     /**
      *  This method is overridden in the autogenerated subclass.


playing with Dictionary alternative; needs testing

--- src/com/phylake/pooling/ObjectPool.as
+++ src/com/phylake/pooling/ObjectPool.as
@@ -1,6 +1,7 @@
 package com.phylake.pooling
 {
     import flash.errors.IllegalOperationError;
+    import flash.utils.Dictionary;

     public class ObjectPool
     {
@@ -43,8 +44,12 @@

         public var maxSizeException:Boolean = true;

-        protected var _available:Vector.<Object> = new Vector.<Object>;
-        protected var _inUse:Vector.<Object> = new Vector.<Object>;
+        protected var _available:Dictionary = new Dictionary;
+        protected var _availableCount:int;
+
+        protected var _inUse:Dictionary = new Dictionary;
+        protected var _inUseCount:int;
+
         protected var _callbacks:Vector.<Function> = new Vector.<Function>;

         protected var _minSize:uint;
@@ -65,17 +70,33 @@

         public function getObject():Object
         {
-            if (_bounded && _inUse.length >= _maxSize)
+            if (_bounded && _inUseCount >= _maxSize)
             {
                 if (maxSizeException)
                 {
                     throw new IllegalOperationError("ObjectPool size exceeded maxSize");
                 }
-                return null;
-            }
-
-            const instance:Object = _available.pop() || _instantiateFunction();
-            _inUse.push(instance);
+                return _instantiateFunction();
+            }
+
+            var instance:Object;
+            for (instance in _available)
+            {
+                break;
+            }
+
+            if (instance)
+            {
+                delete _available[instance];
+                _availableCount--;
+            }
+            else
+            {
+                instance = _instantiateFunction();
+            }
+
+            _inUse[instance] = null;
+            _inUseCount++;
             return instance;
         }

@@ -93,7 +114,7 @@
         {
             if (value == null) throw new ArgumentError("value is null");

-            if (_bounded && _inUse.length >= _maxSize)
+            if (_bounded && _inUseCount >= _maxSize)
             {
                 _callbacks.push(value);
             }
@@ -109,11 +130,15 @@
          */
         public function setObject(instance:Object):void
         {
-            _inUse.pop();
+            if (!instance) return;

-            if (!instance) return;
-
-            if (_bounded && _available.length >= _maxSize)
+            if (instance in _inUse)
+            {
+                delete _inUse[instance];
+                _inUseCount--;
+            }
+
+            if (_bounded && _availableCount >= _maxSize)
             {
                 if (destroyFunction != null) destroyFunction(instance);

@@ -125,12 +150,13 @@
             else
             {
                 reclaimFunction(instance);
-                _available.push(instance);
+                _available[instance] = null;
+                _availableCount++;

                 var f:Function;
                 if (_bounded)
                 {
-                    while (_inUse.length < _maxSize && (f = _callbacks.shift()))
+                    while (_inUseCount < _maxSize && (f = _callbacks.shift()))
                     {
                         f(getObject());
                     }
@@ -144,7 +170,17 @@

         public function get size():int
         {
-            return _inUse.length + _available.length;
+            return _inUseCount + _availableCount;
+        }
+
+        public function get available():int
+        {
+            return _availableCount;
+        }
+
+        public function get inUse():int
+        {
+            return _inUseCount;
         }

         public function destroy(destroyInstances:Boolean = true):void
@@ -152,8 +188,16 @@
             if (destroyInstances && destroyFunction != null)
             {
                 var instance:Object;
-                while (instance = _inUse.pop())     destroyFunction(instance);
-                while (instance = _available.pop()) destroyFunction(instance);
+                for (instance in _inUse)
+                {
+                    delete _inUse[instance];
+                    destroyFunction(instance);
+                }
+                for (instance in _available)
+                {
+                    delete _available[instance];
+                    destroyFunction(instance);
+                }
             }

             _instantiateFunction = null;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/automation/src/mx/automation/codec/KeyCodePropertyCodec.as
+++ frameworks/projects/automation/src/mx/automation/codec/KeyCodePropertyCodec.as
@@ -0,0 +1,173 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.automation.codec
+{
+
+	import flash.ui.Keyboard;
+	import mx.automation.qtp.IQTPPropertyDescriptor;
+	import mx.automation.IAutomationManager;
+	import mx.automation.IAutomationObject;
+
+	/**
+	 * Translates between internal Flex keyCodes and automation-friendly ones
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class KeyCodePropertyCodec extends DefaultPropertyCodec
+	{
+		/**
+		 *  Constructor
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function KeyCodePropertyCodec()
+		{
+			super();
+			init();
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function encode(automationManager:IAutomationManager,
+										obj:Object,
+										pd:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):Object
+		{
+			var val:Object = getMemberFromObject(automationManager, obj, pd);
+
+			if (val)
+				val = fromKeyCode(int(val));
+
+			return val;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function decode(automationManager:IAutomationManager,
+										obj:Object,
+										value:Object,
+										pd:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):void
+		{
+			if (value is String)
+				obj[pd.name] = fromKeyName(String(value));
+		}
+
+		private static var KEY_CODE_TO_STRING:Object;
+
+		/**
+		 *  Documentation is not currently available.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function fromKeyName(name:String):int
+		{
+			if (name.length == 1)
+				return name.charCodeAt(0);
+
+			for (var i:Object in KEY_CODE_TO_STRING)
+			{
+				if (KEY_CODE_TO_STRING[i] == name)
+					return uint(i);
+			}
+			return 0;
+		}
+
+		/**
+		 *  Documentation is not currently available.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function fromKeyCode(code:int):String
+		{
+			//work around for player bug 155528
+			if (code == 0)
+				return "";
+			return (code in KEY_CODE_TO_STRING
+				? KEY_CODE_TO_STRING[code]
+				: String.fromCharCode(code));
+		}
+
+		/**
+		 *  @private
+		 */
+		private static function init():void
+		{
+			KEY_CODE_TO_STRING = {};
+			KEY_CODE_TO_STRING[Keyboard.BACKSPACE] = "BACKSPACE";
+			KEY_CODE_TO_STRING[Keyboard.CAPS_LOCK] = "CAPS_LOCK";
+			KEY_CODE_TO_STRING[Keyboard.CONTROL] = "CONTROL";
+			KEY_CODE_TO_STRING[Keyboard.DELETE] = "DELETE";
+			KEY_CODE_TO_STRING[Keyboard.DOWN] = "DOWN";
+			KEY_CODE_TO_STRING[Keyboard.END] = "END";
+			KEY_CODE_TO_STRING[Keyboard.ENTER] = "ENTER";
+			KEY_CODE_TO_STRING[Keyboard.ESCAPE] = "ESCAPE";
+			KEY_CODE_TO_STRING[Keyboard.F1] = "F1";
+			KEY_CODE_TO_STRING[Keyboard.F2] = "F2";
+			KEY_CODE_TO_STRING[Keyboard.F3] = "F3";
+			KEY_CODE_TO_STRING[Keyboard.F4] = "F4";
+			KEY_CODE_TO_STRING[Keyboard.F5] = "F5";
+			KEY_CODE_TO_STRING[Keyboard.F6] = "F6";
+			KEY_CODE_TO_STRING[Keyboard.F7] = "F7";
+			KEY_CODE_TO_STRING[Keyboard.F8] = "F8";
+			KEY_CODE_TO_STRING[Keyboard.F9] = "F9";
+			KEY_CODE_TO_STRING[Keyboard.F10] = "F10";
+			KEY_CODE_TO_STRING[Keyboard.F11] = "F11";
+			KEY_CODE_TO_STRING[Keyboard.F12] = "F12";
+			KEY_CODE_TO_STRING[Keyboard.F13] = "F13";
+			KEY_CODE_TO_STRING[Keyboard.F14] = "F14";
+			KEY_CODE_TO_STRING[Keyboard.F15] = "F15";
+			KEY_CODE_TO_STRING[Keyboard.HOME] = "HOME";
+			KEY_CODE_TO_STRING[Keyboard.INSERT] = "INSERT";
+			KEY_CODE_TO_STRING[Keyboard.LEFT] = "LEFT";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_0] = "NUMPAD_0";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_1] = "NUMPAD_1";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_2] = "NUMPAD_2";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_3] = "NUMPAD_3";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_4] = "NUMPAD_4";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_5] = "NUMPAD_5";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_6] = "NUMPAD_6";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_7] = "NUMPAD_7";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_8] = "NUMPAD_8";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_9] = "NUMPAD_9";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_ADD] = "NUMPAD_ADD";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_DECIMAL] = "NUMPAD_DECIMAL";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_DIVIDE] = "NUMPAD_DIVIDE";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_ENTER] = "NUMPAD_ENTER";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_MULTIPLY] = "NUMPAD_MULTIPLY";
+			KEY_CODE_TO_STRING[Keyboard.NUMPAD_SUBTRACT] = "NUMPAD_SUBTRACT";
+			KEY_CODE_TO_STRING[Keyboard.PAGE_DOWN] = "PAGE_DOWN";
+			KEY_CODE_TO_STRING[Keyboard.PAGE_UP] = "PAGE_UP";
+			KEY_CODE_TO_STRING[Keyboard.RIGHT] = "RIGHT";
+			KEY_CODE_TO_STRING[Keyboard.SHIFT] = "SHIFT";
+			KEY_CODE_TO_STRING[Keyboard.SPACE] = "SPACE";
+			KEY_CODE_TO_STRING[Keyboard.TAB] = "TAB";
+			KEY_CODE_TO_STRING[Keyboard.UP] = "UP";
+			KEY_CODE_TO_STRING[144 /* not available in Keyboard */] = "NUM_LOCK";
+		}
+	}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18746
Author:   rfrishbe@adobe.com
Date:     2010-11-19T21:47:15.951969Z

Log Message:
-----------
A few MobileIconItemRenderer/MobileItemRenderer checkins

1) Add more layout helper methods: getElementPreferredWidth(), getElementPreferredHeight()
2) Deal with multi-line text reflow for message
3) Have the icon use verticalAlign if there's no message around
4) Change caret index to draw background instead of border

QE notes:
Doc notes:
Bugs: SDK-28217, SDK-28509, SDK-27649, SDK-27799
Reviewer: Alex, Evtim
Tests run: checkintests, mustella cyclone
Is noteworthy for integration: No

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

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -639,15 +639,12 @@
             if (labelDisplay.isTruncated)
                 labelDisplay.text = label;

-            // commit styles so our text measurement is accurate
-            labelDisplay.commitStyles();
-
+            var horizontalPadding:Number = getStyle("paddingLeft") + getStyle("paddingRight");
+            var verticalPadding:Number = getStyle("paddingTop") + getStyle("paddingBottom");
+
             // Text respects padding right, left, top, and bottom
-            measuredWidth = labelDisplay.measuredWidth;
-            measuredWidth += getStyle("paddingLeft") + getStyle("paddingRight");
-
-            measuredHeight = labelDisplay.measuredHeight;
-            measuredHeight += getStyle("paddingTop") + getStyle("paddingBottom");
+            measuredWidth = getElementPreferredWidth(labelDisplay) + horizontalPadding;
+            measuredHeight = getElementPreferredHeight(labelDisplay) + verticalPadding;
         }

         // minimum height of 80 pixels
@@ -726,6 +723,14 @@
         {
             backgroundColor = getStyle("rollOverColor");
         }
+		else if (showsCaret)
+		{
+			// FIXME (rfrishbe): should probably be its own distinct color and style
+			// Also, this is touch-specific...should it be called LabelItemRenderer
+			// if it has touch-specific logic in here?  Should we gate it based
+			// on interactionMode?
+			backgroundColor = getStyle("selectionColor");
+		}
         else
         {
             var alternatingColors:Array = getStyle("alternatingItemColors");
@@ -749,35 +754,21 @@
         // the reason why we draw it in the case of drawBackground == 0 is for
         // mouse hit testing purposes
         graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);
-
-        if (showsCaret)
-        {
-            graphics.lineStyle(1, getStyle("selectionColor"));
-            graphics.drawRect(0.5, 0.5, unscaledWidth-1, unscaledHeight-1);
-        }
-        else
-        {
-            graphics.lineStyle();
-            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
-        }
-
-        graphics.endFill();
-
-        if (!showsCaret)
-        {
-            // FIXME (rfrishbe): separators should be stylable
-
-            // draw seperators: two lines
-            // 1 pixel from bottom
-            graphics.lineStyle(1, 0x1C1C1C);
-            graphics.moveTo(0, unscaledHeight-1);
-            graphics.lineTo(unscaledWidth, unscaledHeight-1);
-
-            // line on the bottom
-            graphics.lineStyle(1, 0x606060);
-            graphics.moveTo(0, unscaledHeight);
-            graphics.lineTo(unscaledWidth, unscaledHeight);
-        }
+		graphics.lineStyle();
+		graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+		graphics.endFill();
+
+		// FIXME (rfrishbe): separators should be stylable
+		// draw seperators: two lines
+		// 1 pixel from bottom
+		graphics.lineStyle(1, 0x1C1C1C);
+		graphics.moveTo(0, unscaledHeight-1);
+		graphics.lineTo(unscaledWidth, unscaledHeight-1);
+
+		// line on the bottom
+		graphics.lineStyle(1, 0x606060);
+		graphics.moveTo(0, unscaledHeight);
+		graphics.lineTo(unscaledWidth, unscaledHeight);
     }

     /**
@@ -837,7 +828,7 @@
             // reset text if it was truncated before.
             if (labelDisplay.isTruncated)
                 labelDisplay.text = label;
-            textHeight = labelDisplay.textHeight + UITextField.TEXT_HEIGHT_PADDING;
+            textHeight = getElementPreferredHeight(labelDisplay);
         }

         // text should take up the rest of the space width-wise, but only let it take up
@@ -855,11 +846,9 @@

     //--------------------------------------------------------------------------
     //
-    //  Event handling
-    //
-    //--------------------------------------------------------------------------
-
-
+    //  Methods: Layout Helpers
+    //
+    //--------------------------------------------------------------------------

     /**
      *  A helper method to position the children of this item renderer.
@@ -867,7 +856,7 @@
      *
You can use this method instead of checking for and using
      *  various interfaces such as ILayoutElement or IFlexDisplayObject.

      *
-     *  @param part The child to position.
+     *  @param element The child to position.
      *
      *  @param x The x-coordinate of the child.
      *
@@ -880,20 +869,20 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function positionElement(part:Object, x:Number, y:Number):void
-    {
-        if (part is ILayoutElement)
-        {
-            ILayoutElement(part).setLayoutBoundsPosition(x, y, false);
-        }
-        else if (part is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(part).move(x, y);
+    protected function positionElement(element:Object, x:Number, y:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).move(x, y);
         }
         else
         {
-            part.x = x;
-            part.y = y;
+            element.x = x;
+            element.y = y;
         }
     }

@@ -903,7 +892,7 @@
      *
You can use this method instead of checking for and using
      *  various interfaces such as ILayoutElement or IFlexDisplayObject.

      *
-     *  @param part The child to position.
+     *  @param element The child to position.
      *
      *  @param x The width of the child.
      *
@@ -916,20 +905,98 @@
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
-    protected function resizeElement(part:Object, width:Number, height:Number):void
-    {
-        if (part is ILayoutElement)
-        {
-            ILayoutElement(part).setLayoutBoundsSize(width, height, false);
-        }
-        else if (part is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(part).setActualSize(width, height);
+    protected function resizeElement(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
         }
         else
         {
-            part.width = width;
-            part.height = height;
+            element.width = width;
+            element.height = height;
+        }
+    }
+
+    /**
+     *  A helper method to retrieve the preferred width of an element
+     *
+     *
You can use this method instead of checking for and using
+     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

+     *
+     *  @param element The child to retrieve the width for
+     *
+     *  @see #sizeElement
+     *  @see #getElementPreferredHeight
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredWidth(element:Object):Number
+    {
+        if (element is ILayoutElement)
+        {
+            return ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            return IFlexDisplayObject(element).measuredWidth;
+        }
+        else if (element is StyleableTextField)
+        {
+            // commit styles to get an accurate measurement
+            StyleableTextField(element).commitStyles();
+
+            return StyleableTextField(element).measuredWidth;
+        }
+        else
+        {
+            return element.width;
+        }
+    }
+
+    /**
+     *  A helper method to retrieve the preferred height of an element
+     *
+     *
You can use this method instead of checking for and using
+     *  various interfaces such as ILayoutElement or IFlexDisplayObject.

+     *
+     *  @param element The child to retrieve the height for
+     *
+     *  @see #sizeElement
+     *  @see #getElementPreferredWidth
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredHeight(element:Object):Number
+    {
+        if (element is ILayoutElement)
+        {
+            return ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            return IFlexDisplayObject(element).measuredHeight;
+        }
+        else if (element is StyleableTextField)
+        {
+            // commit styles to get an accurate measurement
+            StyleableTextField(element).commitStyles();
+
+            return StyleableTextField(element).measuredHeight;
+        }
+        else
+        {
+            return element.height;
         }
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17992
Author:   rfrishbe@adobe.com
Date:     2010-10-01T20:59:13.104275Z

Log Message:
-----------
Making performance changes to optimize list scrolling.  Most of the changes are around gating dispatchEvent() with hasEventListener().  The biggest of these is that UIComponent SHOW and HIDE don't dispatch all the time anymore--they only dispatch if someone has attached an event listener directly to them (capture phase won't work).

Also, adding an mx_internal property for Design View on MobileIconItemRenderer, iconDisplayClass.

Also, adding a FIXME in ButtonSkinbase related to my last change around text measurement.

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

Modified Paths:
--------------
<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/core/ContentRequest.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/wireframe/src/spark/skins/wireframe/DefaultItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/DataRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -315,7 +315,8 @@
     {
         _data = value;

-        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+        if (hasEventListener(FlexEvent.DATA_CHANGE))
+            dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
     }

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


Please more comments

Please more comments

git-svn-id: f772d44cbf86d9968f12179c1556189f5afcea6e@626 e0ac87d7-b42b-0410-9034-8248a05cb448

--- braineditor/Sprite.as
+++ braineditor/Sprite.as
@@ -1,4 +1,6 @@
 import Point;
+//This file should contain all movie clip
+

 class Sprite {
   var mSurface:MovieClip;


Transferred from the Adobe Open Source Subversion Repository

Revision: 15871
Author:   dloverin@adobe.com
Date:     2010-05-03T19:14:33.392012Z

Log Message:
-----------
Changes so modules and sub-applications will not load RSLs that are already loaded.

Changes to support not loading RSLs that are already loaded.

frameworks/projects/framework/src/mx/core/RSLData.as
            New class to allow access to RSL properties in a structured way.

frameworks/projects/framework/src/mx/core/CrossDomainRSLItem.as
            Used new format of rsl data. Cleaned up  constructor.

frameworks/projects/framework/src/mx/core/FlexModuleFactory.as
frameworks/projects/framework/src/mx/managers/SystemManager.as
            Checked if an RSL is already loaded before loading it. In the future this check could retrieve the module factory  of where the RSL should be loaded.

frameworks/projects/framework/src/mx/utils/LoaderUtil.as
            New method to check for loaded RSLs.

modules/compiler/src/java/flex2/tools/PreLink.java
            Generate RSL data in new format. Digests are now always present even when verify-digests is false. The value of verify digests is passed as an RSL property. Cache the value of info().

QE notes: None.
Doc notes: New feature.
Bugs:
Reviewer: Alex
Tests run: checkintests, submitted patch to testing service.
Is noteworthy for integration: No.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/RSLData.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/FlexModuleFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/LoaderUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/CrossDomainRSLItem.as</path>

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

--- frameworks/projects/framework/src/mx/core/RSLData.as
+++ frameworks/projects/framework/src/mx/core/RSLData.as
@@ -0,0 +1,130 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2010 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+
+
+[ExcludeClass]
+
+/**
+ *  A Class the describes configuration data for an RSL.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 2.0
+ *  @productversion Flex 4.5
+ */
+public class RSLData
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    public function RSLData(url:String = null, policyFileUrl:String = null,
+                            digest:String = null, hashType:String = null,
+                            isSigned:Boolean = false,
+                            verifyDigest:Boolean = false)
+    {
+        super();
+
+        this.url = url;
+        this.policyFileUrl = policyFileUrl;
+        this.digest = digest;
+        this.hashType = hashType;
+        this.isSigned = isSigned;
+        this.verifyDigest = verifyDigest;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  url
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  Location of the RSL. The URL can be absolute or relative to the
+     *  application or module.
+     */
+    public var url:String;
+
+    //----------------------------------
+    //  policy file url
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  Location of the policy file.
+     */
+    public var policyFileUrl:String;
+
+    //----------------------------------
+    //  digest
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  The digest of the RSL. This is null for and RSL without a digest.
+     */
+    public var digest:String;
+
+    //----------------------------------
+    //  digest type
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  The type of hash used to create the RSL. This is null for an RSL
+     *  without a digest.
+     */
+    public var hashType:String;
+
+    //----------------------------------
+    //  isSigned
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  True if the RSL has been signed by Adobe. False otherwise.
+     */
+    public var isSigned:Boolean;
+
+    //----------------------------------
+    //  verifyDigest
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  True if the digest must be verified before loading the RSL into memory.
+     *  False allows the RSL to be loaded without verification.
+     */
+    public var verifyDigest:Boolean;
+
+}
+}


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

--- frameworks/projects/mx/src/mx/controls/LinkButton.as
+++ frameworks/projects/mx/src/mx/controls/LinkButton.as
@@ -26,6 +26,11 @@
  *  Corner radius of the highlighted rectangle around a LinkButton.
  *
  *  @default 4
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="cornerRadius", type="Number", format="Length", inherit="no")]

@@ -33,6 +38,11 @@
  *  Color of a LinkButton as a user moves the mouse pointer over it.
  *
  *  @default 0xEEFEE6
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]

@@ -40,6 +50,11 @@
  *  Background color of a LinkButton as a user presses it.
  *
  *  @default 0xB7F39B
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="selectionColor", type="uint", format="Color", inherit="yes")]

@@ -47,6 +62,11 @@
  *  Text color of a LinkButton as a user moves the mouse pointer over it.
  *
  *  @default 0x2B333C
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="textRollOverColor", type="uint", format="Color", inherit="yes")]

@@ -54,6 +74,11 @@
  *  Text color of a LinkButton as a user presses it.
  *
  *  @default 0x2B333C
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Style(name="textSelectedColor", type="uint", format="Color", inherit="yes")]

@@ -124,6 +149,11 @@
  *  @includeExample examples/LinkButtonExample.mxml
  *
  *  @see mx.controls.LinkBar
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class LinkButton extends Button
 {
@@ -149,6 +179,11 @@

 	/**
 	 *  Constructor.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
 	 */
 	public function LinkButton()
 	{


fixed bug where keys & values arrays could be out of sync

Change-Id: I6b4eebc2e091499d2ce273562420832a94efcbd9

--- WeaveData/src/weave/data/ProjectionManager.as
+++ WeaveData/src/weave/data/ProjectionManager.as
@@ -423,10 +423,8 @@
 		{
 			var value:Array = unprojectedColumn.getValueFromKey(keys[i]) as Array;
 			if (value)
-			{
 				numGeoms += value.length;
-				values.push(value);
-			}
+			values.push(value);
 		}
 		keyIndex = 0;
 		coordsVectorIndex = 0;