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

--- frameworks/projects/automation/src/mx/automation/codec/ScrollDetailPropertyCodec.as
+++ frameworks/projects/automation/src/mx/automation/codec/ScrollDetailPropertyCodec.as
@@ -0,0 +1,113 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.automation.qtp.IQTPPropertyDescriptor;
+	import mx.automation.IAutomationManager;
+	import mx.automation.IAutomationObject;
+
+	/**
+	 * Translates between internal Flex ScrollEvent detail and automation-friendly version
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class ScrollDetailPropertyCodec extends DefaultPropertyCodec
+	{
+		/**
+		 *  Constructor
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function ScrollDetailPropertyCodec()
+		{
+			super();
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function encode(automationManager:IAutomationManager,
+										obj:Object,
+										pd:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):Object
+		{
+			var val:int = 0;
+
+			if (!("detail" in obj))
+				return val;
+
+			switch (obj["detail"])
+			{
+				//ScrollEvent.detail
+				case "atBottom" :
+					return 1;
+				case "atLeft" :
+					return 2;
+				case "atRight" :
+					return 3;
+				case "atTop" :
+					return 4;
+				case "lineDown" :
+					return 5;
+				case "lineLeft" :
+					return 6;
+				case "lineRight" :
+					return 7;
+				case "lineUp" :
+					return 8;
+				case "pageDown" :
+					return 9;
+				case "pageLeft" :
+					return 10;
+				case "pageRight" :
+					return 11;
+				case "pageUp" :
+					return 12;
+				case "thumbPosition" :
+					return 13;
+				case "thumbTrack" :
+					return 14;
+			}
+
+			return val;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function decode(automationManager:IAutomationManager,
+										obj:Object,
+										value:Object,
+										pd:IQTPPropertyDescriptor,
+										relativeParent:IAutomationObject):void
+		{
+			var details:Array =
+				[
+					"atBottom", "atLeft", "atRight", "atTop", "lineDown",
+					"lineLeft", "lineRight", "lineUp", "pageDown",
+					"pageLeft", "pageRight", "pageUp", "thumbPosition",
+					"thumbTrack",
+				];
+
+			if ("detail" in obj && value > 0 && value <= details.length)
+				obj["detail"] = details[uint(value)-1];
+		}
+	}
+
+}


Use Grid instead of Tile as the latter requires hardcoding which blows.

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@495 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as
+++ src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as
@@ -24,8 +24,10 @@
 import mx.core.Container;
 import mx.core.UIComponent;

+import mx.containers.Grid;
+import mx.containers.GridItem;
+import mx.containers.GridRow;
 import mx.containers.HBox;
-import mx.containers.Tile;

 import com.threerings.parlor.game.data.GameConfig;
 import com.threerings.parlor.util.ParlorContext;
@@ -41,11 +43,20 @@
 public /*abstract*/ class FlexGameConfigurator extends GameConfigurator
 {
     /**
+     * Configures the number of columns to use when laying out our controls. This must be called
+     * before any calls to {@link #addControl}.
+     */
+    public function setColumns (columns :int) :void
+    {
+        _columns = columns;
+    }
+
+    /**
      * Get the Container that contains the UI elements for this configurator.
      */
     public function getContainer () :Container
     {
-        return _tile;
+        return _grid;
     }

     /**
@@ -56,17 +67,31 @@
      */
     public function addControl (label :UIComponent, control :UIComponent) :void
     {
-        var item :HBox = new HBox();
-        item.width = 225;
-        item.setStyle("horizontalGap", 5);
-        label.width = 95;
-        item.addChild(label);
-        control.width = 125;
-        item.addChild(control);
-        _tile.addChild(item);
+        if (_gridRow == null) {
+            _gridRow = new GridRow();
+            _grid.addChild(_gridRow);
+        }
+        _gridRow.addChild(wrapItem(label));
+        _gridRow.addChild(wrapItem(control));
+        if (_gridRow.numChildren == _columns * 2) {
+            _gridRow = null;
+        }
+    }
+
+    protected function wrapItem (component :UIComponent) :GridItem
+    {
+        var item :GridItem = new GridItem();
+        item.addChild(component);
+        return item;
     }

     /** The grid on which the config options are placed. */
-    protected var _tile :Tile = new Tile();
+    protected var _grid :Grid = new Grid();
+
+    /** The current row to which we're adding controls. */
+    protected var _gridRow :GridRow;
+
+    /** The number of columns in which to lay out our configuration. */
+    protected var _columns :int = 2;
 }
 }


give those controls a bit more room

give those controls a bit more room

git-svn-id: a3e1eb16dde062992de22c830ed8045c8013209a@280 c613c5cb-e716-0410-b11b-feb51c14d237

--- src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as
+++ src/as/com/threerings/parlor/game/client/FlexGameConfigurator.as
@@ -48,7 +48,7 @@
     public function getContainer () :Container
     {
         // mimic the style of the seats grid for consistency
-        _tile.width = 375;
+        _tile.width = 475;
         _tile.styleName = "seatsGrid";
         return _tile;
     }
@@ -64,11 +64,11 @@
             label :UIComponent, control :UIComponent) :void
     {
         var item :HBox = new HBox();
-        item.width = 175;
+        item.width = 225;
         item.setStyle("horizontalGap", 5);
-        label.width = 70;
+        label.width = 95;
         item.addChild(label);
-        control.width = 100;
+        control.width = 125;
         item.addChild(control);
         _tile.addChild(item);
     }


Modified input fields width

Modified input fields width

--- collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
+++ collect-flex/collect-flex-client/src/main/flex/org/openforis/collect/ui/UIBuilder.as
@@ -232,7 +232,7 @@
 						return 100;
 					}
 				} else {
-					return 200;
+					return NaN;
 				}
 			} else if(def is CoordinateAttributeDefinitionProxy) {
 				if(parentLayout == UIUtil.LAYOUT_TABLE) {
@@ -244,6 +244,8 @@
 				return 132;
 			} else if(def is FileAttributeDefinitionProxy) {
 				return 300;
+			} else if(def is NumberAttributeDefinitionProxy) {
+				return 70;
 			} else if(def is RangeAttributeDefinitionProxy) {
 				return 120;
 			} else if(def is TaxonAttributeDefinitionProxy) {
@@ -259,8 +261,9 @@
 					case TextAttributeDefinitionProxy$Type.MEMO:
 						return 300;
 					case TextAttributeDefinitionProxy$Type.SHORT:
+						return 100;
 					default:
-						return 100;
+						return 150;
 				}
 			} else if(def is TimeAttributeDefinitionProxy) {
 				return 64;


http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequestMethod.html The values of the constants in that class are actually uppercase.

--- src/org/igniterealtime/xiff/core/XMPPBOSHConnection.as
+++ src/org/igniterealtime/xiff/core/XMPPBOSHConnection.as
@@ -1,20 +1,20 @@
 /*
  * Copyright (C) 2003-2009 Igniterealtime Community Contributors
- *
+ *
  *     Daniel Henninger
  *     Derrick Grigg <dgrigg@rogers.com>
  *     Juga Paazmaya <olavic@gmail.com>
  *     Nick Velloff <nick.velloff@gmail.com>
  *     Sean Treadway <seant@oncotype.dk>
  *     Sean Voisen <sean@voisen.org>
- *
- *
+ *
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ *
  *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -60,10 +60,11 @@

 		/**
 		 * Keys should match URLRequestMethod constants.
+		 * @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequestMethod.html
 		 */
 		private static const headers:Object = {
-			"post": [],
-			"get": [ 'Cache-Control',
+			"POST": [],
+			"GET": [ 'Cache-Control',
 					 'no-store',
 					 'Cache-Control',
 					 'no-cache',


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

--- frameworks/projects/mx/src/mx/controls/RadioButtonGroup.as
+++ frameworks/projects/mx/src/mx/controls/RadioButtonGroup.as
@@ -0,0 +1,542 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.controls
+{
+
+import flash.events.Event;
+import flash.events.EventDispatcher;
+import mx.core.Application;
+import mx.core.IFlexDisplayObject;
+import mx.core.IMXMLObject;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+import mx.events.ItemClickEvent;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the value of the selected RadioButton control in
+ *  this group changes.
+ *
+ *  @eventType flash.events.Event.CHANGE
+ */
+[Event(name="change", type="flash.events.Event")]
+
+/**
+ *  Dispatched when a user selects a RadioButton control in the group.
+ *  You can also set a handler for individual RadioButton controls.
+ *
+ *  @eventType mx.events.ItemClickEvent.ITEM_CLICK
+ */
+[Event(name="itemClick", type="mx.events.ItemClickEvent")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[DefaultBindingProperty(source="selection", destination="selection")]
+
+[DefaultTriggerEvent("change")]
+
+[IconFile("RadioButtonGroup.png")]
+
+/**
+ *  The RadioButtonGroup control defines a group of RadioButton controls
+ *  that act as a single mutually exclusive control; therefore,
+ *  a user can select only one RadioButton control at a time.
+ *  The id property is required when you use the
+ *  <mx:RadioButtonGroup> tag to define the name
+ *  of the group.
+ *
+ *
Notice that the RadioButtonGroup control is a subclass of EventDispatcher, not UIComponent,
+ *  and implements the IMXMLObject interface.
+ *  All other Flex visual components are subclasses of UIComponent, which implements
+ *  the IUIComponent interface.
+ *  The RadioButtonGroup control has support built into the Flex compiler
+ *  that allows you to use the RadioButtonGroup control as a child of a Flex container,
+ *  event though it does not implement IUIComponent.
+ *  All other container children must implement the IUIComponent interface.

+ *
+ *
Therefore, if you try to define a visual component as a subclass of
+ *  EventDispatcher that implements the IMXMLObject interface,
+ *  you will not be able to use it as the child of a container.

+ *
+ *  @mxml
+ *
+ *
The <mx:RadioButtonGroup> tag inherits all of the
+ *  tag attributes of its superclass, and adds the following tag attributes:

+ *
+ *

+ *  <mx:RadioButtonGroup
+ *    Properties
+ *    enabled="true|false"
+ *    id="No default"
+ *    labelPlacement="right|left|top|bottom"
+ *
+ *    Events
+ *    change="No default"
+ *    itemClick="No default"
+ *  />
+ *

+ *
+ *  @includeExample examples/RadioButtonGroupExample.mxml
+ *
+ *  @see mx.controls.RadioButton
+ */
+public class RadioButtonGroup extends EventDispatcher implements IMXMLObject
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param document In simple cases where a class extends EventDispatcher,
+     *  the document parameter should not be used.
+     *
+     *  @see flash.events.EventDispatcher
+     */
+    public function RadioButtonGroup(document:IFlexDisplayObject = null)
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  The document containing a reference to this RadioButtonGroup.
+     */
+    private var document:IFlexDisplayObject;
+
+    /**
+     *  @private
+     *  An Array of the RadioButtons that belong to this group.
+     */
+    private var radioButtons:Array /* of RadioButton */ = [];
+
+    /**
+     *  @private
+     *  Index for the next RadioButton added to this group.
+     */
+    private var indexNumber:int = 0;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  enabled
+    //----------------------------------
+
+    [Bindable("enabledChanged")]
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  Determines whether selection is allowed.
+     *
+     *  @default true
+     */
+    public function get enabled():Boolean
+    {
+        var s:Number = 0;
+
+        var n:int = numRadioButtons;
+        for (var i:int = 0; i < n; i++)
+        {
+            s = s + getRadioButtonAt(i).enabled;
+        }
+
+        if (s == 0)
+            return false;
+
+        if (s == n)
+            return true;
+
+        return false;
+    }
+
+    /**
+     *  @private
+     */
+    public function set enabled(value:Boolean):void
+    {
+        var n:int = numRadioButtons;
+        for (var i:int = 0; i < n; i++)
+        {
+            getRadioButtonAt(i).enabled = value;
+        }
+
+        dispatchEvent(new Event("enabledChanged"));
+    }
+
+    //----------------------------------
+    //  labelPlacement
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the labelPlacement property.
+     */
+    private var _labelPlacement:String = "right";
+
+    [Bindable("labelPlacementChanged")]
+    [Inspectable(category="General", enumeration="left,right,top,bottom", defaultValue="right")]
+
+    /**
+     *  Position of the RadioButton label relative to the RadioButton icon
+     *  for each control in the group.
+     *  You can override this setting for the individual controls.
+     *
+     *
Valid values in MXML are "right", "left",
+     *  "bottom", and "top".

+     *
+     *
In ActionScript, you use the following constants to set this property:
+     *  ButtonLabelPlacement.RIGHT, ButtonLabelPlacement.LEFT,
+     *  ButtonLabelPlacement.BOTTOM, and ButtonLabelPlacement.TOP.

+     *
+     *  @default "right"
+     */
+    public function get labelPlacement():String
+    {
+        return _labelPlacement;
+    }
+
+    /**
+     *  @private
+     */
+    public function set labelPlacement(value:String):void
+    {
+        _labelPlacement = value;
+
+        var n:int = numRadioButtons;
+        for (var i:int = 0; i < n; i++)
+        {
+            getRadioButtonAt(i).labelPlacement = value;
+        }
+    }
+
+    //----------------------------------
+    //  numRadioButtons
+    //----------------------------------
+
+    [Bindable("numRadioButtonsChanged")]
+
+    /**
+     *  The number of RadioButtons that belong to this RadioButtonGroup.
+     *
+     *  @default "undefined"
+     */
+    public function get numRadioButtons():int
+    {
+        return radioButtons.length;
+    }
+
+    //----------------------------------
+    //  selectedValue
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the selectedValue property.
+     */
+    private var _selectedValue:Object;
+
+    [Bindable("change")]
+    [Bindable("valueCommit")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The value of the value property of the selected
+     *  RadioButton control in the group, if this has been set
+     *  to be something other than null (the default value).
+     *  Otherwise, selectedValue is the value of the
+     *  label property of the selected RadioButton.
+     *  If no RadioButton is selected, this property is null.
+     *
+     *
If you set selectedValue, Flex selects the
+     *  RadioButton control whose value or
+     *  label property matches this value.

+     *
+     *  @default null
+     */
+    public function get selectedValue():Object
+    {
+        if (selection)
+        {
+            return selection.value != null ?
+                   selection.value :
+                   selection.label;
+        }
+
+        return null;
+    }
+
+    /**
+     *  @private.
+     */
+    public function set selectedValue(value:Object):void
+    {
+        _selectedValue = value;
+
+        var n:int = numRadioButtons;
+        for (var i:int = 0; i < n; i++)
+        {
+            var radioButton:RadioButton = getRadioButtonAt(i);
+            if (radioButton.value == value ||
+                radioButton.label == value)
+            {
+                changeSelection(i, false);
+                break;
+            }
+        }
+
+        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+    }
+
+    //----------------------------------
+    //  selection
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Reference to the selected radio button.
+     */
+    private var _selection:RadioButton;
+
+    [Bindable("change")]
+    [Bindable("valueCommit")]
+    [Inspectable(category="General")]
+
+    /**
+     *  Contains a reference to the currently selected
+     *  RadioButton control in the group.
+     *  You can access the property in ActionScript only;
+     *  it is not settable in MXML.
+     *  Setting this property to null deselects the currently selected RadioButton control.
+     *
+     *  @default null
+     */
+    public function get selection():RadioButton
+    {
+        return _selection;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selection(value:RadioButton):void
+    {
+        // Going through the selection setter should never fire a change event.
+        setSelection(value, false);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Implementation of the IMXMLObject.initialized() method
+     *  to support deferred instantiation.
+     *
+     *  @param document The MXML document that created this object.
+     *
+     *  @param id The identifier used by document to refer to this object.
+     *  If the object is a deep property on document, id is null.
+     *
+     *  @see mx.core.IMXMLObject
+     */
+    public function initialized(document:Object, id:String):void
+    {
+        this.document = document ?
+                        IFlexDisplayObject(document) :
+                        IFlexDisplayObject(Application.application);
+    }
+
+    /**
+     *  Returns the RadioButton control at the specified index.
+     *
+     *  @param index The index of the RadioButton control in the
+     *  RadioButtonGroup control, where the index of the first control is 0.
+     *
+     *  @return The specified RadioButton control.
+     */
+    public function getRadioButtonAt(index:int):RadioButton
+    {
+        return RadioButton(radioButtons[index]);
+    }
+
+    /**
+     *  @private
+     *  Add a radio button to the group.
+     */
+    mx_internal function addInstance(instance:RadioButton):void
+    {
+        instance.indexNumber = indexNumber++;
+        instance.addEventListener(Event.REMOVED, radioButton_removedHandler);
+        radioButtons.push(instance);
+
+        if (_selectedValue != null)
+            selectedValue = _selectedValue;
+
+		dispatchEvent(new Event("numRadioButtonsChanged"));
+    }
+
+    /**
+     *  @private
+     *  Remove a radio button from the group.
+     */
+    mx_internal function removeInstance(instance:RadioButton):void
+    {
+        if (instance)
+        {
+
+            var foundInstance:Boolean = false;
+            for (var i:int = 0; i < numRadioButtons; i++)
+            {
+                var rb:RadioButton = getRadioButtonAt(i);
+
+                if (foundInstance)
+                {
+                    // Decrement the indexNumber for each button after the removed button.
+                    rb.indexNumber--;
+                }
+                else if (rb == instance)
+                {
+                	rb.group = null;
+
+                    if (instance == _selection)
+                    {
+                        _selection = null;
+                    }
+                    // Remove the radio button from the internal array
+                    radioButtons.splice(i,1);
+                    foundInstance = true;
+                    indexNumber--;
+                    // redo the same index because we removed the previous item at this index
+                    i--;
+                }
+            }
+
+            if (foundInstance)
+				dispatchEvent(new Event("numRadioButtonsChanged"));
+        }
+    }
+
+    /**
+     *  @private
+     *  Return the value or the label value
+     *  of the selected radio button.
+     */
+    private function getValue():String
+    {
+        if (selection)
+        {
+            return selection.value &&
+                   selection.value is String &&
+                   String(selection.value).length != 0 ?
+                   String(selection.value) :
+                   selection.label;
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function setSelection(value:RadioButton, fireChange:Boolean = true):void
+    {
+        if (value == null && _selection != null)
+        {
+            _selection.selected = false;
+            _selection = null;
+            if (fireChange)
+                dispatchEvent(new Event(Event.CHANGE));
+        }
+        else
+        {
+            var n:int = numRadioButtons;
+            for (var i:int = 0; i < n; i++)
+            {
+                if (value == getRadioButtonAt(i))
+                {
+                    changeSelection(i, fireChange);
+                    break;
+                }
+            }
+        }
+
+        dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT));
+    }
+
+    /**
+     *  @private
+     */
+    private function changeSelection(index:int, fireChange:Boolean = true):void
+    {
+        if (getRadioButtonAt(index))
+        {
+            // Unselect the currently selected radio
+            if (selection)
+                selection.selected = false;
+
+            // Change the focus to the new radio.
+            // Set the state of the new radio to true.
+            // Fire a click event for the new radio.
+            // Fire a click event for the radio group.
+            _selection = getRadioButtonAt(index);
+            _selection.selected = true;
+            if (fireChange)
+                dispatchEvent(new Event(Event.CHANGE));
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+     /**
+     *  @private
+     */
+    private function radioButton_removedHandler(event:Event):void
+    {
+        var rb:RadioButton = event.target as RadioButton;
+        if (rb)
+        {
+        	rb.removeEventListener(Event.REMOVED, radioButton_removedHandler);
+            removeInstance(RadioButton(event.target));
+        }
+    }
+}
+
+}


FLEX-34028: Changed how the down click drag preparation behavior works.  If the CTRL key is down and the current item being clicked on is already selected (meaning would toggle it's selection) it will avoid the drag prep.

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -5629,7 +5629,7 @@
         if (rowIndex == -1 || isCellSelection && columnIndex == -1)
             return;

-        if (dragEnabled && isRowSelectionMode() && selectionContainsIndex(rowIndex))
+        if (event.ctrlKey == false && dragEnabled && isRowSelectionMode() && selectionContainsIndex(rowIndex))
         {
             pendingSelectionOnMouseUp = true;
             pendingSelectionShiftKey = event.shiftKey;


Transferred from the Adobe Open Source Subversion Repository

Revision: 20561
Author:   hmuller@adobe.com
Date:     2011-03-02T22:40:26.962808Z

Log Message:
-----------
GridLayout/layoutLinearElements() no longer sets oldVisibleIndices.length=0 when the elements' factory has changed; the incoming vector is shared state.

Revised DataGrid/initializeGridRowBackground() slightly.

QE notes:
Doc notes:
Bugs: SDK-29802
Reviewer: Carol
Tests run: checkin, mustella
Is noteworthy for integration: no

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

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

--- frameworks/projects/spark/src/spark/components/DataGrid.as
+++ frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -903,22 +903,18 @@
      *  @private
      *  If the alternatingRowColors style is set AND the alternatingRowColorsBackground
      *  skin part has been added AND the grid skin part has been added, then set
-     *  grid.rowBackground = alternatingRowColorsBackground here.
-     *
-     *  Return true if grid.rowBackground was set.
-     */
-    private function initializeGridRowBackground():Boolean
+     *  grid.rowBackground = alternatingRowColorsBackground here.   Otherwise just
+     *  set it to the value of the rowBackground skin part (property).
+     */
+    private function initializeGridRowBackground():void
     {
         if (!grid)
-            return false;
+            return;

         if ((getStyle("alternatingRowColors") as Array) && alternatingRowColorsBackground)
-        {
             grid.rowBackground = alternatingRowColorsBackground;
-            return true;
-        }
-
-        return false;
+        else
+            grid.rowBackground = rowBackground;
     }

     //--------------------------------------------------------------------------
@@ -2524,9 +2520,7 @@

             // IFactory valued skin parts => Grid visual element properties

-            if (!initializeGridRowBackground()) // sets grid.rowBackground if alternatingRowColors set
-                grid.rowBackground = rowBackground;
-
+            initializeGridRowBackground(); // sets grid.rowBackground if alternatingRowColors set
             grid.columnSeparator = columnSeparator;
             grid.rowSeparator = rowSeparator;
             grid.hoverIndicator = hoverIndicator;
@@ -2670,7 +2664,6 @@
             grid.hoverIndicator = null;
             grid.caretIndicator = null;
             grid.selectionIndicator = null;
-            grid.rowBackground = null;

             // IDataGridElements: grid, columnHeaderGroup


Transferred from the Adobe Open Source Subversion Repository

Revision: 3723
Author:   gosmith@adobe.com
Date:     2008-10-17T21:06:45.659621Z

Log Message:
-----------
The 'content' property of an FxTextArea now updates as you edit text in it. The failure to do so was having the side-effect of not being able to set 'content' to something, then edit, then set 'content' back to the same thing.

Reviewer: Ryan
Bugs: SDK-17396
QA: No
Doc: No

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

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

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -16,7 +16,9 @@

 import mx.components.baseClasses.FxScrollBar;
 import mx.components.baseClasses.FxTextBase;
+import mx.core.mx_internal;
 import mx.core.ScrollPolicy;
+import mx.events.TextOperationEvent;

 //--------------------------------------
 //  Other metadata
@@ -434,6 +436,32 @@

 	//--------------------------------------------------------------------------
     //
+    //  Overridden event handlers: FxTextBase
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function textView_changeHandler(
+                                        event:TextOperationEvent):void
+	{
+		// Note: We don't call the superhandler here
+        // because it immediately fetches textView.text
+        // to extract the text from the TextFlow.
+        // That's too expensive for an FxTextArea,
+        // which might have a lot of leaf nodes.
+
+        // Update our storage variable for the content.
+		_content = textView.content;
+        textInvalid = true;
+
+		// Redispatch the event that came from the TextView.
+		dispatchEvent(event);
+	}
+
+	//--------------------------------------------------------------------------
+    //
     //  Event handlers
     //
     //--------------------------------------------------------------------------


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

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

 package mx.charts.effects
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 14269
Author:   deeptika@adobe.com
Date:     2010-02-19T05:38:49.309420Z

Log Message:
-----------
Mirroring changes: Merging revision 14241 from 4.x branch
QE notes:
Doc notes:
Bugs:
Reviewer:
Tests run:
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/series/BarSeries.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/chartClasses/ChartBase.as</path>
<path kind="dir" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/charts/series/ColumnSeries.as</path>

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

--- frameworks/projects/charts/src/mx/charts/series/ColumnSeries.as
+++ frameworks/projects/charts/src/mx/charts/series/ColumnSeries.as
@@ -2404,7 +2404,10 @@
                     label.text = "";
                 else if (chart && !(ColumnChart(chart).showLabelVertically))
                 {
-                    label.setStyle('textAlign','left');
+					if(chart && chart.layoutDirection == "rtl")		//Align labels to right of the item in rtl layout
+                    	label.setStyle('textAlign','right');
+					else											//Align them to left of the column in ltr layout
+						label.setStyle('textAlign','left');
                     label.setStyle('paddingLeft',0);
                     label.rotation = 0;
                 }


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

--- frameworks/projects/framework/src/mx/effects/CompositeEffect.as
+++ frameworks/projects/framework/src/mx/effects/CompositeEffect.as
@@ -82,6 +82,11 @@
  *    </mx:children>
  *  </mx:<i>tagname</i>>
  *  </pre>
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public class CompositeEffect extends Effect
 {
@@ -98,6 +103,11 @@
      *
      *  @param target This argument is ignored for composite effects.
      *  It is included only for consistency with other types of effects.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function CompositeEffect(target:Object = null)
     {
@@ -136,6 +146,11 @@

     /**
      *  An Array containing the child effects of this CompositeEffect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     private var _children:Array = [];

@@ -165,6 +180,11 @@
      * all child effects. This takes into account the startDelay and repetition
      * info for all child effects, along with their durations, and returns the
      * appropriate result.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get compositeDuration():Number
     {
@@ -428,6 +448,11 @@
      *
      *  @param childEffect Child effect to be added
      *  to the composite effect.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function addChild(childEffect:IEffect):void
     {


Transferred from the Adobe Open Source Subversion Repository

Revision: 2462
Author:   jimurphy@adobe.com
Date:     2008-07-14T19:13:06.620116Z

Log Message:
-----------
gumbo push to trunk

Modified Paths:
--------------
214 paths were modified

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

--- frameworks/projects/framework/src/mx/graphics/GradientStroke.as
+++ frameworks/projects/framework/src/mx/graphics/GradientStroke.as
@@ -0,0 +1,308 @@
+package mx.graphics
+{
+import mx.core.mx_internal;
+
+public class GradientStroke extends GradientBase
+{
+	public function GradientStroke(weight:Number = 0,
+                                     pixelHinting:Boolean = false,
+                                     scaleMode:String = "normal",
+                                     caps:String = null,
+                                     joints:String = null,
+                                     miterLimit:Number = 0)
+    {
+        super();
+
+        this.weight = weight;
+        this.pixelHinting = pixelHinting;
+        this.scaleMode = scaleMode;
+        this.caps = caps;
+        this.joints = joints;
+        this.miterLimit = miterLimit;
+    }
+
+	//----------------------------------
+    //  caps
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the caps property.
+     */
+    private var _caps:String = null;
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General", enumeration="round,square,none", defaultValue="round")]
+
+    /**
+     *  A value from the CapsStyle class
+     *  that specifies the type of caps at the end of lines.
+     *
+     *
Valid values are CapsStyle.NONE,
+     *  CapsStyle.ROUND, and CapsStyle.SQUARE.
+     *  A null value is equivalent to
+     *  CapsStyle.ROUND.

+     *
+     *  @default null
+     */
+    public function get caps():String
+    {
+        return _caps;
+    }
+
+    /**
+     *  @private
+     */
+    public function set caps(value:String):void
+    {
+        var oldValue:String = _caps;
+        if (value != oldValue)
+        {
+            _caps = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "caps", oldValue, value);
+        }
+    }
+
+	//----------------------------------
+    //  joints
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the joints property.
+     */
+    private var _joints:String = null;
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General", enumeration="round,bevel,miter", defaultValue="round")]
+
+    /**
+     *  A value from the JointStyle class that specifies the type
+     *  of joint appearance used at angles.
+     *
+     *
Valid values are JointStyle.BEVEL,
+     *  JointStyle.MITER, and JointStyle.ROUND.
+     *  A null value is equivalent to
+     *  JoinStyle.ROUND.

+     *
+     *  @default null
+     */
+    public function get joints():String
+    {
+        return _joints;
+    }
+
+    /**
+     *  @private
+     */
+    public function set joints(value:String):void
+    {
+        var oldValue:String = _joints;
+        if (value != oldValue)
+        {
+            _joints = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "joints", oldValue, value);
+        }
+    }
+
+    //----------------------------------
+    //  miterLimit
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the miterLimit property.
+     */
+    private var _miterLimit:Number = 0;
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  A number that indicates the limit at which a miter is cut off.
+     *
+     *
Valid values range from 0 to 255
+     *  (and values outside of that range are rounded to 0 or 255).

+     *
+     *
This value is only used if the jointStyle
+     *  is set to JointStyle.MITER.

+     *
+     *
The miterLimit value represents the length that a miter
+     *  can extend beyond the point at which the lines meet to form a joint.
+     *  The value expresses a factor of the line thickness.
+     *  For example, with a miterLimit factor of 2.5
+     *  and a thickness of 10 pixels,
+     *  the miter is cut off at 25 pixels.

+     *
+     *  @default 0
+     */
+    public function get miterLimit():Number
+    {
+        return _miterLimit;
+    }
+
+    /**
+     *  @private
+     */
+    public function set miterLimit(value:Number):void
+    {
+        var oldValue:Number = _miterLimit;
+        if (value != oldValue)
+        {
+            _miterLimit = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "miterLimit", oldValue, value);
+        }
+    }
+
+    //----------------------------------
+    //  pixelHinting
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the pixelHinting property.
+     */
+    private var _pixelHinting:Boolean = false;
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  A Boolean value that specifies whether to hint strokes to full pixels.
+     *
+     *
This affects both the position of anchors of a curve
+     *  and the line stroke size itself.

+     *
+     *
With pixelHinting set to true,
+     *  Flash Player and AIR hint line widths to full pixel widths.
+     *  With pixelHinting set to false,
+     *  disjoints can appear for curves and straight lines.

+     *
+     *  @default false
+     */
+    public function get pixelHinting():Boolean
+    {
+        return _pixelHinting;
+    }
+
+    /**
+     *  @private
+     */
+    public function set pixelHinting(value:Boolean):void
+    {
+        var oldValue:Boolean = _pixelHinting;
+        if (value != oldValue)
+        {
+            _pixelHinting = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "pixelHinting", oldValue, value);
+        }
+    }
+
+    //----------------------------------
+    //  scaleMode
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the scaleMode property.
+     */
+    private var _scaleMode:String = "normal";
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General", enumeration="normal,vertical,horizontal,none", defaultValue="normal")]
+
+    /**
+     *  A value from the LineScaleMode class
+     *  that  specifies which scale mode to use.
+     *  Value valids are:
+     *
+     *

+     *

+     *  LineScaleMode.NORMAL—
+     *  Always scale the line thickness when the object is scaled  (the default).
+     *

+     *

+     *  LineScaleMode.NONE—
+     *  Never scale the line thickness.
+     *

+     *

+     *  LineScaleMode.VERTICAL—
+     *  Do not scale the line thickness if the object is scaled vertically
+     *  only.
+     *

+     *

+     *  LineScaleMode.HORIZONTAL—
+     *  Do not scale the line thickness if the object is scaled horizontally
+     *  only.
+     *

+     *

+     *
+     *  @default LineScaleMode.NORMAL
+     */
+    public function get scaleMode():String
+    {
+        return _scaleMode;
+    }
+
+    /**
+     *  @private
+     */
+    public function set scaleMode(value:String):void
+    {
+        var oldValue:String = _scaleMode;
+        if (value != oldValue)
+        {
+            _scaleMode = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "scaleMode", oldValue, value);
+        }
+    }
+
+    //----------------------------------
+    //  weight
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the weight property.
+     */
+    private var _weight:Number;
+
+    [Bindable("propertyChange")]
+    [Inspectable(category="General")]
+
+    /**
+     *  The stroke weight, in pixels.
+     */
+    public function get weight():Number
+    {
+        return _weight;
+    }
+
+    /**
+     *  @private
+     */
+    public function set weight(value:Number):void
+    {
+        var oldValue:Number = _weight;
+        if (value != oldValue)
+        {
+            _weight = value;
+
+            mx_internal::dispatchGradientChangedEvent(
+                                "weight", oldValue, value);
+        }
+    }
+
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 12469
Author:   jimurphy@adobe.com
Date:     2009-12-03T22:04:16.560316Z

Log Message:
-----------
fix offsets for FB.  Convert line ending from lf to crlf in svn for the proects directory only.  When checking project files in, be sure to save you files this way.  Another update to make sure happens is set the svn properties svn:eol-style = native and svn:mime-type = text/plain (these have been updated on theses files as well)

QE notes: make sure the proper class is selected
Doc notes: no
Bugs: http://bugs.adobe.com/jira/browse/SDK-24498
Reviewer:
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
133 paths were modified

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

--- frameworks/projects/spark/src/spark/components/PopUpPosition.as
+++ frameworks/projects/spark/src/spark/components/PopUpPosition.as
@@ -84,4 +84,4 @@
 	public static const RIGHT:String = "right";

 }
-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 4005
Author:   rfrishbe@adobe.com
Date:     2008-11-04T01:07:38.597640Z

Log Message:
-----------
Change in the way item renderers lay them selves out.  Before we were using 100% width and 100% height.  Now, we're using horizontalAlign and verticalAlign to accomplish this, which are properties added to VerticalLayout and HorizontalLayout, respectively.  horizontalAlign takes values "left", "center", "right", "justify", and "contentJustify".  "justify" sizes all elements to the width of the component.  "contentJustify" sizes all elements to the size of the largest child (with a minimum of the width of the parent component).  Similar, verticalAlign takes "top", "middle", "bottom", "justify", and "contentJustify".

The default List skin sets the VerticalLayout's horizontalAlign to "contentJustify."  Most lists should use "contentJustify" or "justify" if you don't want scrollbars.  If you want to change your list to a horizontal list, you change the layout to a horizontal layout.  However, you must set the verticalAlign property on the horizontal layout correctly--otherwise it'll default to "top" and probably won't do what you want.

Ran checkintests and the following mustella tests: layout, list, Group, DataGroup, FxDataContainer, and FxContainer.  Some DataGroup tests were failing but should be because of an unrelated, local change.  All other tests are passing.

QE Notes: Failing tests are excluded.  Please update them (I think all just need to add verticalAlign="contentJustify" in the horizontal layout case) and re-include them.  Also, please write tests for this new functionality.
Doc Notes: None
Bugs: SDK-17198
Reviewer: Evtim

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxListSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDataContainerSkin.mxml</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalAlign.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/development/eclipse/flex/flex4test/src/flex4test.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/layout/LayoutBase.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -44,6 +44,33 @@
     	                                                       layoutItem.maxSize.y );
     	return percentHeight < height ? percentHeight : height;
     }
+
+    private static function sizeLayoutItem(layoutItem:ILayoutItem, height:Number,
+                                           verticalAlign:String, restrictedHeight:Number,
+                                           width:Number, variableColumnWidth:Boolean,
+                                           columnWidth:Number):void
+    {
+        var newHeight:Number = NaN;
+
+        // if verticalAlign is "justify" or "contentJustify",
+        // restrict the height to restrictedHeight.  Otherwise,
+        // size it normally
+        if (verticalAlign == VerticalAlign.JUSTIFY ||
+            verticalAlign == VerticalAlign.CONTENT_JUSTIFY)
+        {
+            newHeight = restrictedHeight;
+        }
+        else
+        {
+            if (hasPercentHeight(layoutItem))
+               newHeight = calculatePercentHeight(layoutItem, height);
+        }
+
+        if (variableColumnWidth)
+            layoutItem.setActualSize(width, newHeight);
+        else
+            layoutItem.setActualSize(columnWidth, newHeight);
+    }

     //--------------------------------------------------------------------------
     //
@@ -305,6 +332,42 @@
     public function get lastIndexInView():int
     {
         return _lastIndexInView;
+    }
+
+    //----------------------------------
+    //  verticalAlign
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _verticalAlign:String = VerticalAlign.TOP;
+
+    [Inspectable(category="General")]
+
+    /** Horizontal alignment of children in the container.
+     *  Possible values are "top", "middle",
+     *  "bottom", "justify",
+     *  and "contentJustify".
+     *  The default value is "top", but some containers,
+     *  such as List, use a different default value.  There are constants
+     *  for these values in mx.layout.VerticalAlign.
+     */
+    public function get verticalAlign():String
+    {
+        return _verticalAlign;
+    }
+
+    /**
+     *  @private
+     */
+    public function set verticalAlign(value:String):void
+    {
+        if (value == _verticalAlign)
+            return;
+
+        _verticalAlign = value;
+        invalidateTargetDisplayList();
     }

     /**
@@ -790,29 +853,42 @@
             return;

         // TODO EGeorgie: use vector
-        var layoutItemArray:Array = new Array();
         var layoutItem:ILayoutItem;
         var count:uint = layoutTarget.numLayoutItems;
-        var totalCount:uint = count; // How many items will be laid out
-        for (var i:int = 0; i < count; i++)
-        {
-            layoutItem = layoutTarget.getLayoutItemAt(i);
-            if (!layoutItem || !layoutItem.includeInLayout)
+
+        // if verticalAlign is "contentJustify", we need to figure out contentHeight.
+        // contentHeight gets sent in to distributeWidth(), but is only used if
+        // verticalAlign is "justify" (contentHeight is unscaledHeight) or
+        // verticalAlign is "contentJustify" (contentHeight is the maximum height
+        // of all its children and a minimum of unscaledHeight)
+        var contentHeight:Number = unscaledHeight;
+
+        if (verticalAlign != VerticalAlign.TOP)
+        {
+            for (var i:int = 0; i < count; i++)
             {
-            	totalCount--;
-                continue;
-            }
-            layoutItemArray.push(layoutItem);
-        }
-
-        var totalWidthToDistribute:Number = unscaledWidth;
-        if (totalCount > 1)
-            totalWidthToDistribute -= (totalCount - 1) * gap;
-
-        distributeWidth(layoutItemArray, totalWidthToDistribute, unscaledHeight);
-
-        // TODO EGeorgie: verticalAlign
+                layoutItem = layoutTarget.getLayoutItemAt(i);
+                if (!layoutItem || !layoutItem.includeInLayout)
+                    continue;
+
+                var layoutItemHeight:Number;
+                if (hasPercentHeight(layoutItem))
+                    layoutItemHeight = calculatePercentHeight(layoutItem, unscaledHeight);
+                else
+                    layoutItemHeight = layoutItem.preferredSize.y;
+
+                contentHeight = Math.max(contentHeight, layoutItemHeight);
+            }
+        }
+
+        distributeWidth(unscaledWidth, unscaledHeight, contentHeight);
+
+        // default to top (0)
         var vAlign:Number = 0;
+        if (verticalAlign == VerticalAlign.MIDDLE)
+            vAlign = .5;
+        else if (verticalAlign == VerticalAlign.BOTTOM)
+            vAlign = 1;

         // If columnCount wasn't set, then as the LayoutItems are positioned
         // we'll count how many columns fall within the layoutTarget's scrollRect
@@ -828,26 +904,20 @@
         var maxY:Number = 0;
         var firstColInView:int = -1;
         var lastColInView:int = -1;
-
-        // columnWidth can be expensive to compute
-        var cw:Number = (variableColumnWidth) ? 0 : columnWidth;

-
         for (var index:int = 0; index < count; index++)
         {
             layoutItem = layoutTarget.getLayoutItemAt(index);
             if (!layoutItem || !layoutItem.includeInLayout)
-                continue;
-
-            // Set the layout item's acutual size and position
-            var y:Number = (unscaledHeight - layoutItem.actualSize.y) * vAlign;
+                continue;
+
+            // Set the layout item's position
+            var y:Number = (contentHeight - layoutItem.actualSize.y) * vAlign;
             layoutItem.setActualPosition(x, y);
-            var dy:Number = layoutItem.actualSize.y;
-            if (!variableColumnWidth)
-                layoutItem.setActualSize(cw, dy);
-
+
             // Update maxX,Y, first,lastVisibleIndex, and x
             var dx:Number = layoutItem.actualSize.x;
+            var dy:Number = layoutItem.actualSize.y;
             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);
             if (!clipContent ||
@@ -881,22 +951,35 @@
      *  The return value is any extra space that's left over
      *  after growing all children to their maxWidth.
      */
-    public function distributeWidth(layoutItemArray:Array,
-                                     width:Number,
-                                     height:Number):Number
+    public function distributeWidth(width:Number,
+                                    height:Number,
+                                    restrictedHeight:Number):Number
     {
         var spaceToDistribute:Number = width;
         var totalPercentWidth:Number = 0;
         var childInfoArray:Array = [];
         var childInfo:HLayoutItemFlexChildInfo;
         var newHeight:Number;
+        var layoutItem:ILayoutItem;
+
+        // columnWidth can be expensive to compute
+        var cw:Number = (variableColumnWidth) ? 0 : columnWidth;
+        var count:uint = target.numLayoutItems;
+        var totalCount:uint = count; // number of items to use in gap calculation

         // If the child is flexible, store information about it in the
         // childInfoArray. For non-flexible children, just set the child's
         // width and height immediately.
-        for each (var layoutItem:ILayoutItem in layoutItemArray)
-        {
-            if (hasPercentWidth(layoutItem))
+        for (var index:int = 0; index < count; index++)
+        {
+            layoutItem = target.getLayoutItemAt(index);
+            if (!layoutItem || !layoutItem.includeInLayout)
+            {
+                totalCount--;
+                continue;
+            }
+
+            if (hasPercentWidth(layoutItem) && variableColumnWidth)
             {
                 totalPercentWidth += layoutItem.percentWidth;

@@ -910,14 +993,15 @@
             }
             else
             {
-                newHeight = NaN;
-                if (hasPercentHeight(layoutItem))
-                   newHeight = calculatePercentHeight(layoutItem, height);
+                sizeLayoutItem(layoutItem, height, verticalAlign,
+                               restrictedHeight, NaN, variableColumnWidth, cw);

-                layoutItem.setActualSize(NaN, newHeight);
                 spaceToDistribute -= layoutItem.actualSize.x;
             }
         }
+
+        if (totalCount > 1)
+            spaceToDistribute -= (totalCount-1) * gap;

         // Distribute the extra space among the flexible children
         if (totalPercentWidth)
@@ -926,13 +1010,12 @@
                                                                 spaceToDistribute,
                                                                 totalPercentWidth,
                                                                 childInfoArray);
+
             for each (childInfo in childInfoArray)
             {
-            	newHeight = NaN;
-            	if (hasPercentHeight(childInfo.layoutItem))
-            	   newHeight = calculatePercentHeight(childInfo.layoutItem, height);
-
-                childInfo.layoutItem.setActualSize(childInfo.size, newHeight);
+                sizeLayoutItem(childInfo.layoutItem, height, verticalAlign,
+                               restrictedHeight, childInfo.size,
+                               variableColumnWidth, cw);
             }
         }
         return spaceToDistribute;


Transferred from the Adobe Open Source Subversion Repository

Revision: 17468
Author:   klin@adobe.com
Date:     2010-08-24T20:48:50.296115Z

Log Message:
-----------
When measuring the layoutTarget's size, Horizontal/VerticalLayout will take into account the size of the live renderers if the target is a DataGroup. This will produce a better measured size when dealing with renderers that change size often. In measureVirtual(), we go through the live renderers and add their preferred size and subtract the cached size from the measured size.

QE notes: No
Doc notes: No
Bugs: SDK-25605
Reviewer: Evtim
Tests run: checkintests, VerticalLayout, HorizontalLayout
Is noteworthy for integration: No

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

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -21,6 +21,7 @@
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;

+import spark.components.DataGroup;
 import spark.components.supportClasses.GroupBase;
 import spark.core.NavigationUnit;
 import spark.layouts.supportClasses.DropLocation;
@@ -1338,10 +1339,32 @@
                 oldLength = llv.length;
                 llv.length = measuredEltCount;
             }
-            // paddingLeft is already taken into account as the majorAxisOffset of the llv
-            layoutTarget.measuredWidth = llv.end(measuredEltCount - 1) + paddingRight;
+
+            // paddingRight is already taken into account as the majorAxisOffset of the llv
+            // Measured size according to the cached actual size:
+            var measuredWidth:Number = llv.end(measuredEltCount - 1) + paddingRight;
+
+            // For the live ItemRenderers use the preferred size
+            // instead of the cached actual size:
+            var dataGroupTarget:DataGroup = layoutTarget as DataGroup;
+            if (dataGroupTarget)
+            {
+                var indices:Vector.<int> = dataGroupTarget.getItemIndicesInView();
+                for each (var i:int in indices)
+                {
+                    var element:ILayoutElement = dataGroupTarget.getElementAt(i);
+                    if (element)
+                    {
+                        measuredWidth -= llv.getMajorSize(i);
+                        measuredWidth += element.getPreferredBoundsWidth();
+                    }
+                }
+            }
+
+            layoutTarget.measuredWidth = measuredWidth;
+
             if (oldLength != -1)
-                llv.length = oldLength;
+                llv.length = oldLength;
         }
         else
         {
@@ -2105,8 +2128,8 @@
 }
 }

+import mx.containers.utilityClasses.FlexChildInfo;
 import mx.core.ILayoutElement;
-import mx.containers.utilityClasses.FlexChildInfo;

 class HLayoutElementFlexChildInfo extends FlexChildInfo
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 6266
Author:   egeorgie@adobe.com
Date:     2009-04-24T23:09:01.304621Z

Log Message:
-----------
Layout PARB changes

Major (most probably will require updates):
- LayoutBase.getScrollPositionDelta() -> getScrollPositionDeltaToElement()
- HorizontalLayout, VerticalLayout method inView() -> fractionOfElementInView()
- LayoutElementFactory is deleted, interface ILayoutElement is implemented by UIComponent, GraphicElement, VisualSprite, no need for casting in those cases, cast to ILayoutElement in case of type Object.
- TileLayout.elementHorizontalAlign -> horizontalAlign
- TileLayout.elementVerticalAlign -> verticalAlign
- TileJustifyRows -> RowAlign
- TileJustifyColumsn > ColumnAlign
- TileLayout.justifyRows -> rowAlign
- TileLayout.justifyColumns -> columnAling
- TileJustifyRows.NONE, "none" -> TOP, "top"
- TileJustifyRows.GAP_SIZE, "gapSize" -> JUSTIFY_USING_GAP, "justifyUsingGap"
- TileJustifyRows.ROW_SIZE, "rowSize" -> JUSTIFY_USING_HEIGHT, "justifyUsingHeight"
- TileJustifyColumns.NONE, "none" -> LEFT, "left"
- TileJustifyColumns.GAP_SIZE, "gapSize" -> JUSTIFY_USING_GAP, "justifyUsingGap"
- TileJustifyColumns.COLUMN_SIZE, "columnSize" -> JUSTIFY_USING_WIDTH, "justifyUsingWidth"
- TileLayout.set rowCount -> set requestedRowCount
- add TileLayout.get requestedRowCount
- TileLayout.set columnCount -> set requestedColumnCount
- add TileLayout.get requestedColumnCount

Minor (may require updates, but not that probable):
- get baselinePosition() is moved from IVisualElement to ILayoutElement.
- setLayoutBoundsSize() does not have default NaN values for width & height (but still logic is the same).
- name of ILayoutInterface methods' parameter "postTransform" is renamed to "postLayoutTransform".
- name of ILayoutInterface methods' parameter "triggerLayout" is renamed to "invalidateLayout".
- LayoutBase methods invalidateTargetSizeAndDisplayList() and invalidateTargetSize() are removed.
- LayoutBase method getTargetScrollRect() is renamed to getScrollRect().

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Hans, Ryan
tests: checkintests, mustella (gumbo/layout, gumbo/group, gumbo/dataGroup)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/layout/layout_tester.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/VerticalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Ellipse.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IVisualElement.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/RowAlign.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/LayoutElementUIComponentUtils.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/TileJustifyRows.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/effects/supportClasses/Animate3DInstance.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/HorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ILayoutElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/TileLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/HScrollBar.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/ColumnAlign.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LayoutElementFactory.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBarHorizontalLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Path.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/Rect.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/TileJustifyColumns.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/BasicLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/core/TextBaseClass.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/Block.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/layout/supportClasses/LinearLayoutVector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollerLayout.as</path>

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

--- frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -26,10 +26,57 @@
 import spark.layout.supportClasses.LayoutElementHelper;
 import spark.layout.supportClasses.LinearLayoutVector;

-
 /**
- *  Documentation is not currently available.
- *
+ *  The HorizontalLayout arranges the layout elements in a horizontal sequence,
+ *  left to right, with optional gaps between the elements and optional padding
+ *  around the sequence of elements.
+ *
+ *
During measure(), the default size of the container is calculated by
+ *  accumulating the preferred sizes of the elements, including gaps and padding.
+ *  When requestedColumnCount is set, only the space for that many elements
+ *  will be measured, starting from the first element.

+ *
+ *
During updateDisplayList(), the width of each element is calculated
+ *  according to the following rules, listed in their respective order of
+ *  precedence (element's minimum width and maximum width are always respected):
+ *

+ *
If variableColumnWidth is false, then set the element's width to the
+ *    value of the columnWidth property.

+ *
+ *
If the element's percentWidth is set, then calculate the element's
+ *    width by distributing the available container width between all
+ *    elements with percentWidth setting. The available container width
+ *    is equal to the container width minus the gaps, the padding and the
+ *    space occupied by the rest of the elements. The element's precentWidth
+ *    property is ignored when the layout is virtualized.

+ *
+ *
Set the element's width to its preferred width.

+ *

+ *
+ *  The height of each element is calculated according to the following rules,
+ *  listed in their respective order of precedence (element's minium height and
+ *  maximum height are always respected):
+ *

+ *
If verticalAlign is "justify" then set the element's height to the
+ *    container height.

+ *
+ *
If verticalAlign is "contentJustify" then set the element's height
+ *    to the maximum between the container's height and all elements' preferred
+ *    height.

+ *
+ *
If the element's percentHeight is set, then calculate the element's
+ *    height as a percentage of the container's height.

+ *
+ *
Set the element's height to its preferred height.

+ *

+ *
+ *  The horizontal position of the elements is determined by arranging them
+ *  in a horizontal sequence, left to right, taking into account the padding
+ *  before the first element and the gaps between the elements.
+ *
+ *  The vertical position of the elements is determined by the layout's
+ *  verticalAlign property.

+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
@@ -459,11 +506,7 @@
         if (value == _variableColumnWidth) return;

         _variableColumnWidth = value;
- 		var layoutTarget:GroupBase = target;
-        if (layoutTarget != null) {
-    		layoutTarget.invalidateSize();
-        	layoutTarget.invalidateDisplayList();
-        }
+        invalidateTargetSizeAndDisplayList();
     }

     //----------------------------------
@@ -485,7 +528,7 @@
      *  Note that the column may only be partially in view.
      *
      *  @see lastIndexInView
-     *  @see inView
+     *  @see fractionOfElementInView
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -517,7 +560,7 @@
      *  Note that the column may only be partially in view.
      *
      *  @see firstIndexInView
-     *  @see inView
+     *  @see fractionOfElementInView
      *
      *  @langversion 3.0
      *  @playerversion Flash 10
@@ -575,7 +618,10 @@
             return;

         _verticalAlign = value;
-        invalidateTargetDisplayList();
+
+        var layoutTarget:GroupBase = target;
+        if (layoutTarget)
+            layoutTarget.invalidateDisplayList();
     }

     /**
@@ -626,7 +672,7 @@
      *  @playerversion AIR 1.5
      *  @productversion Flex 4
      */
-    public function inView(index:int):Number
+    public function fractionOfElementInView(index:int):Number
     {
         var g:GroupBase = target;
         if (!g)
@@ -756,7 +802,7 @@
             return;
         }

-        var scrollR:Rectangle = getTargetScrollRect();
+        var scrollR:Rectangle = getScrollRect();
         if (!scrollR)
         {
             setIndexInView(0, n);
@@ -863,7 +909,7 @@
     {
         var n:int = g.numElements;

-        if (inView(i) >= 1)
+        if (fractionOfElementInView(i) >= 1)
         {
             // Special case: if we hit the first/last element,
             // then return the area of the padding so that we
@@ -1095,7 +1141,7 @@
      *
      *  The layoutTarget's measuredMinWidth is the sum of the minWidths of
      *  layout elements that have specified a value for the percentWidth
-     *  property, and the preferredWidtj of the elements that have not,
+     *  property, and the preferredWidth of the elements that have not,
      *  plus the sum of the gaps between elements.
      *
      *  The difference reflects the fact that elements which specify
@@ -1504,8 +1550,30 @@
             updateDisplayListVirtual();
         else
             updateDisplayListReal();
-    }
-
+    }
+
+    /**
+     *  @private
+     *  Convenience function for subclasses that invalidates the
+     *  target's size and displayList so that both layout's measure()
+     *  and updateDisplayList methods get called.
+     *
+     *
Typically a layout invalidates the target's size and display list so that
+     *  it gets a chance to recalculate the target's default size and also size and
+     *  position the target's elements. For example changing the gap
+     *  property on a VerticalLayout will internally call this method
+     *  to ensure that the elements are re-arranged with the new setting and the
+     *  target's default size is recomputed.

+     */
+    private function invalidateTargetSizeAndDisplayList():void
+    {
+        var g:GroupBase = target;
+        if (!g)
+            return;
+
+        g.invalidateSize();
+        g.invalidateDisplayList();
+    }
 }
 }


Fixed ddelay state change

Fixed ddelay state change

--- src/Displays/DDelay.as
+++ src/Displays/DDelay.as
@@ -199,7 +199,7 @@
 					maxDelay = Math.max(module.delay, maxDelay);

 			for each (var displayModule:DModule in displayModules) {
-				if (!displayModule.exists)
+				if (!displayModule.module.deployed)
 					continue;

 				var distFraction:Number = displayModule.module.delay / maxDelay;


fixes bug in zoomToSelection() when zooming to a single point.

Change-Id: I563fee96d40672565f9a44a69f4172f070d39319

--- WeaveUISpark/src/weave/visualization/layers/PlotManager.as
+++ WeaveUISpark/src/weave/visualization/layers/PlotManager.as
@@ -319,17 +319,25 @@
 			// make sure callbacks only trigger once.
 			getCallbackCollection(zoomBounds).delayCallbacks();

-			// zoom to that bounds, expanding the area to keep the fixed aspect ratio
-			// if tempBounds is undefined and enableAutoZoomToExtent is enabled, this will zoom to the full extent.
-			zoomBounds.setDataBounds(tempBounds, true);
-
-			// zoom out to include the specified margin
-			zoomBounds.getDataBounds(tempBounds);
-			var scale:Number = 1 / (1 - zoomMarginPercent);
-			tempBounds.setWidth(tempBounds.getWidth() * scale);
-			tempBounds.setHeight(tempBounds.getHeight() * scale);
-			zoomBounds.setDataBounds(tempBounds);
-
+			if (tempBounds.isEmpty())
+			{
+				zoomBounds.getDataBounds(tempDataBounds);
+				tempDataBounds.setCenter(tempBounds.getXCenter(), tempBounds.getYCenter());
+				zoomBounds.setDataBounds(tempDataBounds);
+			}
+			else
+			{
+				// zoom to that bounds, expanding the area to keep the fixed aspect ratio
+				// if tempBounds is undefined and enableAutoZoomToExtent is enabled, this will zoom to the full extent.
+				zoomBounds.setDataBounds(tempBounds, true);
+
+				// zoom out to include the specified margin
+				zoomBounds.getDataBounds(tempBounds);
+				var scale:Number = 1 / (1 - zoomMarginPercent);
+				tempBounds.setWidth(tempBounds.getWidth() * scale);
+				tempBounds.setHeight(tempBounds.getHeight() * scale);
+				zoomBounds.setDataBounds(tempBounds);
+			}
 			getCallbackCollection(zoomBounds).resumeCallbacks();
 		}


Transferred from the Adobe Open Source Subversion Repository

Revision: 17360
Author:   chiedozi@adobe.com
Date:     2010-08-18T00:07:57.520197Z

Log Message:
-----------
ViewNavigator now executes navigation operations a frame later to allow renderers to properly redraw themselves before creating a view (SDK-27068).
Refactored some of the session persistence logic out of the application classes into ViewNavigatorBase.
The label, icon and activeView properties now exist on ViewNavigatorBase

QE notes:
Doc notes:
Bugs: SDK-27068
Reviewer: Ryan
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigator.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/NavigationStack.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ViewNavigatorApplication.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ViewNavigatorApplication.as
@@ -126,6 +126,7 @@
         else
             return navigatorProperties.navigationStack;
     }
+
     /**
      *  @private
      */
@@ -147,7 +148,18 @@
     //
     //--------------------------------------------------------------------------

-    // TODO (Chiedozi): why this way
+    //----------------------------------
+    //  canCancelBackKeyBehavior
+    //----------------------------------
+    /**
+     *  @private
+     */
+    override public function get canCancelBackKeyBehavior():Boolean
+    {
+        return navigator && navigator.canCancelBackKeyBehavior;
+    }
+
+    // TODO (Chiedozi): Why is this a getter instead of public var
     //----------------------------------
     //  firstViewData
     //----------------------------------
@@ -265,6 +277,7 @@
         else
             return navigatorProperties.actionLayout;
     }
+
     /**
      *  @private
      */
@@ -304,6 +317,7 @@
         else
             return navigatorProperties.navigationContent;
     }
+
     /**
      *  @private
      */
@@ -340,6 +354,7 @@
         else
             return navigatorProperties.navigationLayout;
     }
+
     /**
      *  @private
      */
@@ -409,6 +424,7 @@
         else
             return navigatorProperties.titleContent;
     }
+
     /**
      *  @private
      */
@@ -445,6 +461,7 @@
         else
             return navigatorProperties.titleLayout;
     }
+
     /**
      *  @private
      */
@@ -467,7 +484,7 @@
     //--------------------------------------------------------------------------

     /**
-     *  @inheritDoc
+     *  @private
      */
     // TODO (chiedozi): Should these be refactored into the base class?
     override protected function backKeyHandler():void
@@ -478,13 +495,8 @@
     }

     /**
-     *
-     */
-    override public function canCancelDefaultBackKeyBehavior():Boolean
-    {
-        return  navigator && navigator.canCancelDefaultBackKeyBehavior();
-    }
-
+     *  @private
+     */
     override protected function orientationChangeHandler(event:StageOrientationEvent):void
     {
         super.orientationChangeHandler(event);
@@ -493,20 +505,21 @@
             navigator.landscapeOrientation = landscapeOrientation;
     }

+    /**
+     *  @private
+     */
     override protected function persistApplicationState():void
     {
         super.persistApplicationState();
-
-        if (navigator)
-        {
-            // TODO (chiedozi): Fold into navigator
-            if (navigator.activeView)
-               navigator.persistCurrentView();
-
-            persistenceManager.setProperty("navigationStack", navigationStack);
-        }
-    }
-
+
+        // TODO (chiedozi): Rename save to maybe get?
+        if (navigator)
+            persistenceManager.setProperty("navigatorState", navigator.saveViewData());
+    }
+
+    /**
+     *  @private
+     */
     override protected function registerPeristenceClassAliases():void
     {
         super.registerPeristenceClassAliases();
@@ -517,19 +530,20 @@
         registerClassAlias("NavigationStack", NavigationStack);
     }

+    /**
+     * @private
+     */
     override protected function restoreApplicationState():void
     {
+        // TODO (chiedozi): Figure out how to refactor this into base class
         super.restoreApplicationState();

         if (persistenceManager.enabled)
         {
-            var savedNavigationStack:NavigationStack =
-                persistenceManager.getProperty("navigationStack") as NavigationStack;
-
-            if (savedNavigationStack)
-            {
-                navigationStack = savedNavigationStack;
-            }
+            var savedState:Object = persistenceManager.getProperty("navigatorState");
+
+            if (savedState)
+                navigator.restoreViewData(savedState);
         }
     }

@@ -539,6 +553,9 @@
     //
     //--------------------------------------------------------------------------

+    /**
+     *  @private
+     */
     override protected function partAdded(partName:String, instance:Object):void
     {
         super.partAdded(partName, instance);
@@ -606,7 +623,10 @@
             systemManager.stage.focus = navigator;
         }
     }
-
+
+    /**
+     *  @private
+     */
     override protected function partRemoved(partName:String, instance:Object):void
     {
         super.partRemoved(partName, instance);


SoundGroupController の _isMute が何故か初期値 true になっていたのを修正

--- project/SoundConductor/src/jp/hiiragi/managers/soundConductor/SoundGroupController.as
+++ project/SoundConductor/src/jp/hiiragi/managers/soundConductor/SoundGroupController.as
@@ -71,7 +71,7 @@
 //--------------------------------------------------------------------------
 		public function SoundGroupController(groupName:String)
 		{
-			_isMute = true;
+			_isMute = false;

 			_groupName = groupName;
 			_groupVolumeController = new ParameterController(1);


Transferred from the Adobe Open Source Subversion Repository

Revision: 19614
Author:   mcho@adobe.com
Date:     2011-01-05T23:34:52.119707Z

Log Message:
-----------
Text alignment for LabelItemRenderer and IconItemRenderer

QE notes:
Doc notes:
Bugs:
Reviewer: ryan f, jason sj
Tests run: checkintests
Is noteworthy for integration:

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/IconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -291,18 +291,18 @@
 		{
 			case DPIClassification.DPI_320:
 			{
-				itemMiniumumHeight = 88;
+				itemMinimumHeight = 88;
 				break;
 			}
 			case DPIClassification.DPI_240:
 			{
-				itemMiniumumHeight = 66;
+				itemMinimumHeight = 66;
 				break;
 			}
 			default:
 			{
 				// default PPI160
-				itemMiniumumHeight = 44;
+				itemMinimumHeight = 44;
 				break;
 			}
 		}
@@ -680,7 +680,7 @@
 	//
 	//--------------------------------------------------------------------------
 	// Enforced minimum height of the item renderer
-	protected var itemMiniumumHeight:uint = 0;
+	protected var itemMinimumHeight:uint = 0;

     //--------------------------------------------------------------------------
@@ -728,19 +728,18 @@

             // Text respects padding right, left, top, and bottom
 			labelDisplay.commitStyles();
-			var metrics:TextLineMetrics = labelDisplay.getLineMetrics(0);
             measuredWidth = labelDisplay.measuredTextSize.x + horizontalPadding;

-			// We need the ascent that doesn't include the "slop"
-			var realAscent:Number = metrics.ascent - 2;
-            measuredHeight = realAscent + verticalPadding;
+			// FIXME mcho: use a baselineShift style
+			var textShift:Number = 3;
+            measuredHeight = labelDisplay.getLineMetrics(0).ascent - textShift + verticalPadding;
 		}

         // enforce minimum height
-        measuredHeight = Math.max(measuredHeight, itemMiniumumHeight);
+        measuredHeight = Math.max(measuredHeight, itemMinimumHeight);

         measuredMinWidth = 0;
-        measuredMinHeight = itemMiniumumHeight;
+        measuredMinHeight = itemMinimumHeight;
     }

     /**
@@ -796,6 +795,8 @@
                                       unscaledHeight:Number):void
     {
         // figure out backgroundColor
+		// FIXME mcho: need to define a style to use for background color. Right now
+		// we hard code to white
         var backgroundColor:uint;
         var drawBackground:Boolean = true;
         var downColor:* = getStyle("downColor");
@@ -831,12 +832,13 @@

                 backgroundColor = alternatingColors[itemIndex % alternatingColors.length];
             }
-            else
-            {
-                // don't draw background if it is the contentBackgroundColor. The
-                // list skin handles the background drawing for us.
-                drawBackground = false;
-            }
+			else
+			{
+				// don't draw background if it is the contentBackgroundColor. The
+				// list skin handles the background drawing for us.
+				drawBackground = false;
+			}
+
         }

         // draw backgroundColor
@@ -883,13 +885,17 @@
 			bottomSeparatorAlpha = .2;
 		}

+		var dataGroup:DataGroup = parent as DataGroup;
+		var isLast:Boolean = (dataGroup && (itemIndex == dataGroup.numElements - 1));
+
+
 		// draw separators
 		graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
 		graphics.drawRect(0, 0, unscaledWidth, 1);
 		graphics.endFill();

 		graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
-		graphics.drawRect(0, unscaledHeight - 1, unscaledWidth, 1);
+		graphics.drawRect(0, unscaledHeight - (isLast ? 0 : 1), unscaledWidth, 1);
 		graphics.endFill();

@@ -904,11 +910,13 @@
 		}

 		// bottom
-		var dataGroup:DataGroup = parent as DataGroup;
-		if (dataGroup && itemIndex == dataGroup.numElements - 1)
+		if (isLast)
 		{
+			// we want to offset the bottom by 1 so that we don't get
+			// a double line at the bottom of the list if there's a
+			// border
 			graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
-			graphics.drawRect(0, unscaledHeight, unscaledWidth, 1);
+			graphics.drawRect(0, unscaledHeight + 1, unscaledWidth, 1);
 			graphics.endFill();
 		}

@@ -952,8 +960,19 @@
         var viewWidth:Number  = unscaledWidth  - paddingLeft - paddingRight;
         var viewHeight:Number = unscaledHeight - paddingTop  - paddingBottom;

+		var vAlign:Number;
+		if (verticalAlign == "top")
+			vAlign = 0;
+		else if (verticalAlign == "bottom")
+			vAlign = 1;
+		else // if (verticalAlign == "middle")
+			vAlign = 0.5;
+
         // measure the label component
-        var textHeight:Number = 0;
+		// text should take up the rest of the space width-wise, but only let it take up
+		// its measured textHeight so we can position it later based on verticalAlign
+		var labelWidth:Number = Math.max(viewWidth, 0);
+        var labelHeight:Number = 0;

         if (label != "")
         {
@@ -963,37 +982,20 @@
             if (labelDisplay.isTruncated)
                 labelDisplay.text = label;

-			textHeight = labelDisplay.measuredTextSize.y;
-        }
-
+			labelHeight = labelDisplay.measuredTextSize.y;
+        }
+
+		setElementSize(labelDisplay, labelWidth, labelHeight);
+
+		// FIXME mcho: use a baselineShift style
 		var metrics:TextLineMetrics = labelDisplay.getLineMetrics(0);
-
-		var ascentDelta:Number = textHeight - (metrics.ascent - 2); // We need the ascent that doesn't include the "slop"
-
-        // text should take up the rest of the space width-wise, but only let it take up
-        // its measured textHeight so we can position it later based on verticalAlign
-        var labelWidth:Number = Math.max(viewWidth, 0);
-        var labelHeight:Number = Math.max(Math.min(viewHeight + ascentDelta, textHeight), 0);
-        setElementSize(labelDisplay, labelWidth, labelHeight);
-
-		var labelY:Number = 0;
-
-		// Vertical align is calcuated differently for top/bottom/middle. To get as accurate as possible we
-		// want to avoid calculations using the slop.  We only use it when we absolutely need it when
-		// verticalAlign == "top".
-		if (verticalAlign == "top")
-			labelY = paddingTop - (StyleableTextField.TEXT_HEIGHT_PADDING/2 + 3); // accounts for gutter and slop
-		else if (verticalAlign == "bottom")
-			labelY = viewHeight - (metrics.ascent + StyleableTextField.TEXT_HEIGHT_PADDING/2) + paddingTop; //viewHeight - (labelHeight - metrics.descent - metrics.leading) + paddingTop;
-		else // if (verticalAlign == "middle")
-			labelY = Math.round(.5 * (viewHeight - (textHeight - metrics.descent + StyleableTextField.TEXT_HEIGHT_PADDING))) + paddingTop;
-		// made "middle" last even though it's most likely so it is the default and if someone
-		// types "center", then it will still vertically center itself.
-
+		var textShift:Number = 3;
+		var labelY:Number = Math.round(vAlign * (viewHeight - (metrics.ascent - textShift))) - StyleableTextField.TEXT_HEIGHT_PADDING/2 - textShift + paddingTop;
 		setElementPosition(labelDisplay, paddingLeft, labelY);
-
+
         // attempt to truncate the text now that we have its official width
         labelDisplay.truncateToFit();
+
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 18035
Author:   egeorgie@adobe.com
Date:     2010-10-06T19:01:59.480083Z

Log Message:
-----------
Fix SDK-27904 Spark Button icon property needs to be a style

In this change:
- remove the "icon" property and replace it with an "icon" non-inheriting style for Button & friends.
- exclude the "icon" style for CheckBox and RadioButton
- The protected "iconInstance" variable in ButtonSkinBase is replaced with protected methods "getIconDisplay()" and "setIcon()"

QE notes: Verify skins look as expected; Update mustella
Doc notes: Make sure doc reflects the change from property to style.
Bugs: SDK-27642
Reviewer: Corey, Glenn, Jason
Tests run: checkin tests, some mobile mustella
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/CheckBox.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/spark/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/SelectableButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/skins/SparkButtonSkin.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBarBase.as
@@ -546,30 +546,29 @@
         // iconFunction takes precedence.
         if (_iconFunction != null)
         {
-            ButtonBase(renderer).icon = _iconFunction(item);
+            ButtonBase(renderer).setStyle("icon", _iconFunction(item));
             return;
         }

         // iconField
-        if (_iconField && _iconField.length > 0)
-        {
-            if (item is Object)
+        if (_iconField &&
+            _iconField.length > 0 &&
+            item is Object)
+        {
+            try
             {
-                try
+                if (item[_iconField] != null)
                 {
-                    if (item[_iconField] != null)
-                    {
-                        ButtonBase(renderer).icon = item[_iconField];
-                        return;
-                    }
-                }
-                catch(e:Error)
-                {
+                    ButtonBase(renderer).setStyle("icon", item[_iconField]);
+                    return;
                 }
             }
-        }
-
-        ButtonBase(renderer).icon = null;
+            catch(e:Error)
+            {
+            }
+        }
+
+        ButtonBase(renderer).clearStyle("icon");
     }

     /**