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

--- frameworks/projects/mx/src/mx/containers/Panel.as
+++ frameworks/projects/mx/src/mx/containers/Panel.as
@@ -0,0 +1,1896 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2004-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers
+{
+
+import flash.display.DisplayObject;
+import flash.display.Graphics;
+import flash.events.Event;
+import flash.events.MouseEvent;
+import flash.geom.Rectangle;
+import flash.text.TextLineMetrics;
+import mx.automation.IAutomationObject;
+import mx.containers.utilityClasses.BoxLayout;
+import mx.containers.utilityClasses.CanvasLayout;
+import mx.containers.utilityClasses.ConstraintColumn;
+import mx.containers.utilityClasses.ConstraintRow;
+import mx.containers.utilityClasses.IConstraintLayout;
+import mx.containers.utilityClasses.Layout;
+import mx.controls.Button;
+import mx.core.Container;
+import mx.core.ContainerLayout;
+import mx.core.EdgeMetrics;
+import mx.core.EventPriority;
+import mx.core.FlexVersion;
+import mx.core.IFlexDisplayObject;
+import mx.core.IFlexModuleFactory;
+import mx.core.IFontContextComponent;
+import mx.core.IUIComponent;
+import mx.core.IUITextField;
+import mx.core.UIComponent;
+import mx.core.UIComponentCachePolicy;
+import mx.core.UITextField;
+import mx.core.UITextFormat;
+import mx.core.mx_internal;
+import mx.effects.EffectManager;
+import mx.events.CloseEvent;
+import mx.managers.ISystemManager;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.styles.StyleProxy;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+include "../styles/metadata/AlignStyles.as";
+include "../styles/metadata/GapStyles.as";
+include "../styles/metadata/ModalTransparencyStyles.as";
+
+/**
+ *  Alpha of the title bar, control bar and sides of the Panel.
+ *  The default value is 0.4.
+ */
+[Style(name="borderAlpha", type="Number", inherit="no")]
+
+/**
+ *  Thickness of the bottom border of the Panel control.
+ *  If this style is not set and the Panel control contains a ControlBar
+ *  control, the bottom border thickness equals the thickness of the top border
+ *  of the panel; otherwise the bottom border thickness equals the thickness
+ *  of the left border.
+ *
+ *  @default NaN
+ */
+[Style(name="borderThicknessBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Thickness of the left border of the Panel.
+ *
+ *  @default 10
+ */
+[Style(name="borderThicknessLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Thickness of the right border of the Panel.
+ *
+ *  @default 10
+ */
+[Style(name="borderThicknessRight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Thickness of the top border of the Panel.
+ *
+ *  @default 2
+ */
+[Style(name="borderThicknessTop", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Name of the CSS style declaration that specifies styles to apply to
+ *  any control bar child subcontrol.
+ *
+ *  @default null
+ */
+[Style(name="controlBarStyleName", type="String", inherit="no")]
+
+/**
+ *  Radius of corners of the window frame.
+ *
+ *  @default 4
+ */
+[Style(name="cornerRadius", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Boolean property that controls the visibility
+ *  of the Panel container's drop shadow.
+ *
+ *  @default true
+ */
+[Style(name="dropShadowEnabled", type="Boolean", inherit="no")]
+
+/**
+ *  Array of two colors used to draw the footer
+ *  (area for the ControlBar container) background.
+ *  The first color is the top color.
+ *  The second color is the bottom color.
+ *  The default values are null, which
+ *  makes the control bar background the same as
+ *  the panel background.
+ *
+ *  @default null
+ */
+[Style(name="footerColors", type="Array", arrayType="uint", format="Color", inherit="yes")]
+
+/**
+ *  Array of two colors used to draw the header.
+ *  The first color is the top color.
+ *  The second color is the bottom color.
+ *  The default values are null, which
+ *  makes the header background the same as the
+ *  panel background.
+ *
+ *  @default null
+ */
+[Style(name="headerColors", type="Array", arrayType="uint", format="Color", inherit="yes")]
+
+/**
+ *  Height of the header.
+ *  The default value is based on the style of the title text.
+ */
+[Style(name="headerHeight", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Alphas used for the highlight fill of the header.
+ *
+ *  @default [0.3,0]
+ */
+[Style(name="highlightAlphas", type="Array", arrayType="Number", inherit="no")]
+
+/**
+ *  Number of pixels between the container's lower border
+ *  and its content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Number of pixels between the container's top border
+ *  and its content area.
+ *
+ *  @default 0
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Flag to enable rounding for the bottom two corners of the container.
+ *  Does not affect the upper two corners, which are normally round.
+ *  To configure the upper corners to be square,
+ *  set cornerRadius to 0.
+ *
+ *  @default false
+ */
+[Style(name="roundedBottomCorners", type="Boolean", inherit="no")]
+
+/**
+ *  Direction of drop shadow.
+ *  Possible values are "left", "center",
+ *  and "right".
+ *
+ *  @default "center"
+ */
+[Style(name="shadowDirection", type="String", enumeration="left,center,right", inherit="no")]
+
+/**
+ *  Distance of drop shadow.
+ *  Negative values move the shadow above the panel.
+ *
+ *  @default 2
+ */
+[Style(name="shadowDistance", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Style declaration name for the status in the title bar.
+ *
+ *  @default "windowStatus"
+ */
+
+[Style(name="statusStyleName", type="String", inherit="no")]
+
+/**
+ *  The title background skin.
+ *
+ *  @default mx.skins.halo.TitleBackground
+ */
+[Style(name="titleBackgroundSkin", type="Class", inherit="no")]
+
+/**
+ *  Style declaration name for the text in the title bar.
+ *  The default value is "windowStyles",
+ *  which causes the title to have boldface text.
+ *
+ *  @default "windowStyles"
+ */
+[Style(name="titleStyleName", type="String", inherit="no")]
+
+//--------------------------------------
+//  Effects
+//--------------------------------------
+
+/**
+ *  Specifies the effect to play after a Resize effect finishes playing.
+ *  To disable the default Dissolve effect, so that the children are hidden
+ *  instantaneously, set the value of the
+ *  resizeEndEffect property to "none".
+ *
+ *  @default "Dissolve"
+ */
+[Effect(name="resizeEndEffect", event="resizeEnd")]
+
+/**
+ *  Specifies the effect to play before a Resize effect begins playing.
+ *  To disable the default Dissolve effect, so that the children are hidden
+ *  instantaneously, set the value of the
+ *  resizeStartEffect property to "none".
+ *
+ *  @default "Dissolve"
+ */
+[Effect(name="resizeStartEffect", event="resizeStart")]
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="focusIn", kind="event")]
+[Exclude(name="focusOut", kind="event")]
+
+[Exclude(name="focusBlendMode", kind="style")]
+[Exclude(name="focusSkin", kind="style")]
+[Exclude(name="focusThickness", kind="style")]
+
+[Exclude(name="focusInEffect", kind="effect")]
+[Exclude(name="focusOutEffect", kind="effect")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[AccessibilityClass(implementation="mx.accessibility.PanelAccImpl")]
+
+[IconFile("Panel.png")]
+
+/**
+ *  A Panel container consists of a title bar, a caption, a border,
+ *  and a  content area for its children.
+ *  Typically, you use Panel containers to wrap top-level application modules.
+ *  For example, you could include a shopping cart in a Panel container.
+ *
+ *
The Panel container has the following default sizing characteristics:

+ *

+ *

+ *           Characteristic
+ *           Description
+ *

+ *

+ *           Default size
+ *           Height is large enough to hold all of its children at the default height of the children,
+ *               plus any vertical gaps between the children, the top and bottom padding, the top and bottom borders,
+ *               and the title bar.

+ *               Width is the larger of the default width of the widest child plus the left and right padding of the
+ *               container, or the width of the title text, plus the border.
+ *

+ *

+ *           Padding
+ *           4 pixels for the top, bottom, left, and right values.
+ *

+ *

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

+ *
+ *

+ *  <mx:Panel
+ *   Properties
+ *   layout="vertical|horizontal|absolute"
+ *   status=""
+ *   title=""
+ *   titleIcon="null"
+ *   Styles
+ *   borderAlpha="0.4"
+ *   borderThicknessBottom="NaN"
+ *   borderThicknessLeft="10"
+ *   borderThicknessRight="10"
+ *   borderThicknessTop="2"
+ *   controlBarStyleName="null"
+ *   cornerRadius="4"
+ *   dropShadowEnabled="true|false"
+ *   footerColors="null"
+ *   headerColors="null"
+ *   headerHeight="Based on style of title"
+ *   highlightAlphas="[0.3,0]"
+ *   horizontalAlign="left|center|right"
+ *   horizontalGap="8"
+ *   modalTransparency="0.5"
+ *   modalTransparencyBlur="3"
+ *   modalTransparencyColor="#DDDDDD"
+ *   modalTransparencyDuration="100"
+ *   paddingBottom="0"
+ *   paddingTop="0"
+ *   roundedBottomCorners="false|true"
+ *   shadowDirection="center|left|right"
+ *   shadowDistance="2"
+ *   statusStyleName="windowStatus"
+ *   titleBackgroundSkin="TitleBackground"
+ *   titleStyleName="windowStyles"
+ *   verticalAlign="top|middle|bottom"
+ *   verticalGap="6"
+ *   Effects
+ *   resizeEndEffect="Dissolve"
+ *   resizeStartEffect="Dissolve"
+ *   >
+ *      ...
+ *      child tags
+ *      ...
+ *  </mx:Panel>
+ *

+ *
+ *  @includeExample examples/SimplePanelExample.mxml
+ *
+ *  @see mx.containers.ControlBar
+ *  @see mx.containers.VBox
+ */
+public class Panel extends Container
+	implements IConstraintLayout, IFontContextComponent
+{
+    include "../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static const HEADER_PADDING:Number = 14;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class mixins
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Placeholder for mixin by PanelAccImpl.
+     */
+    mx_internal static var createAccessibilityImplementation:Function;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function Panel()
+    {
+        super();
+
+        // If the user hasn't explicitly set a resizeStartEffect
+        // or resizeEndEffect for this Panel, then we want to use
+        // the Dissolve effect (which is specified in the Panel's
+        // style sheet). Unfortunately, there's no automated mechanism
+        // to hook up the EffectManager, so I need to do that here.
+        // Also see the comment in defaults.css.
+        addEventListener("resizeStart", EffectManager.eventHandler,
+                         false, EventPriority.EFFECT);
+        addEventListener("resizeEnd", EffectManager.eventHandler,
+                         false, EventPriority.EFFECT);
+
+        layoutObject = new BoxLayout();
+        layoutObject.target = this;
+
+		showInAutomationHierarchy = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var layoutObject:Layout;
+
+    /**
+     *  @private
+     *  Is there a close button? Panel itself never has one,
+     *  but its subclass TitleWindow can set this flag to true.
+     */
+    mx_internal var _showCloseButton:Boolean = false;
+
+    /**
+     *  @private
+     *  A reference to this Panel container's title bar skin.
+     *  This is a child of the titleBar.
+     */
+    mx_internal var titleBarBackground:IFlexDisplayObject;
+
+    /**
+     *  @private
+     *  A reference to this Panel container's title icon.
+     */
+    mx_internal var titleIconObject:Object = null;
+
+    /**
+     *  @private
+     *  A reference to this Panel container's close button, if any.
+     *  This is a sibling of the titleBar, not its child.
+     */
+    mx_internal var closeButton:Button;
+
+    /**
+     *  @private
+     *  true until the component has finished initializing
+     */
+    private var initializing:Boolean = true;
+
+    /**
+     *  @private
+     */
+    private var panelViewMetrics:EdgeMetrics;
+
+    /**
+     *  @private
+     *  Horizontal location where the user pressed the mouse button
+     *  on the titlebar to start dragging, relative to the original
+     *  horizontal location of the Panel.
+     */
+    private var regX:Number;
+
+    /**
+     *  @private
+     *  Vertical location where the user pressed the mouse button
+     *  on the titlebar to start dragging, relative to the original
+     *  vertical location of the Panel.
+     */
+    private var regY:Number;
+
+	/**
+	 *  @private
+	 */
+	private var checkedForAutoSetRoundedCorners:Boolean;
+
+	/**
+	 *  @private
+	 */
+	private var autoSetRoundedCorners:Boolean;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  baselinePosition
+    //----------------------------------
+
+    /**
+     *  @private
+     *  The baselinePosition of a Panel is calculated for its title.
+     */
+    override public function get baselinePosition():Number
+    {
+    	if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+    		return super.baselinePosition;
+
+		if (!validateBaselinePosition())
+			return NaN;
+
+	    return titleBar.y + titleTextField.y + titleTextField.baselinePosition;
+    }
+
+    //----------------------------------
+    //  cacheAsBitmap
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function set cacheAsBitmap(value:Boolean):void
+    {
+        super.cacheAsBitmap = value;
+
+        // If we got cached, create the content pane so the content area of
+        // this panel gets cached with an opaque background.
+        if (cacheAsBitmap && !contentPane
+                && cachePolicy != UIComponentCachePolicy.OFF
+                && getStyle("backgroundColor"))
+        {
+            createContentPane();
+            invalidateDisplayList();
+        }
+    }
+
+    //----------------------------------
+    //  enabled
+    //----------------------------------
+
+    [Inspectable(category="General", enumeration="true,false", defaultValue="true")]
+
+    /**
+     *  @private
+     */
+    override public function set enabled(value:Boolean):void
+    {
+        super.enabled = value;
+
+        if (titleTextField)
+            titleTextField.enabled = value;
+
+        if (statusTextField)
+            statusTextField.enabled = value;
+
+        if (controlBar)
+            controlBar.enabled = value;
+
+        if (closeButton)
+            closeButton.enabled = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+ 	//----------------------------------
+    //  _closeButtonStyleFilters
+    //----------------------------------
+
+
+	private static var _closeButtonStyleFilters:Object =
+	{
+		"closeButtonUpSkin" : "closeButtonUpSkin",
+		"closeButtonOverSkin" : "closeButtonOverSkin",
+		"closeButtonDownSkin" : "closeButtonDownSkin",
+		"closeButtonDisabledSkin" : "closeButtonDisabledSkin",
+		"closeButtonSkin" : "closeButtonSkin",
+		"repeatDelay" : "repeatDelay",
+		"repeatInterval" : "repeatInterval"
+    };
+
+ 	/**
+     *  The set of styles to pass from the Panel to the close button.
+     *  @see mx.styles.StyleProxy
+     *  @review
+     */
+	protected function get closeButtonStyleFilters():Object
+	{
+		return _closeButtonStyleFilters;
+	}
+
+	//----------------------------------
+	//  constraintColumns
+	//----------------------------------
+
+    [ArrayElementType("mx.containers.utilityClasses.ConstraintColumn")]
+	[Inspectable(arrayType="mx.containers.utilityClasses.ConstraintColumn")]
+
+	/**
+     *  @private
+     *  Storage for the constraintColumns property.
+     */
+    private var _constraintColumns:Array = [];
+
+	/**
+	 *  @copy mx.containers.utilityClasses.IConstraintLayout#constraintColumns
+	 */
+	public function get constraintColumns():Array
+    {
+        return _constraintColumns;
+    }
+
+    /**
+     *  @private
+     */
+    public function set constraintColumns(value:Array):void
+    {
+    	if (value != _constraintColumns)
+    	{
+	    	var n:int = value.length;
+	    	for (var i:int = 0; i < n; i++)
+	    	{
+	    		ConstraintColumn(value[i]).container = this;
+	    	}
+			_constraintColumns = value;
+
+			invalidateSize();
+			invalidateDisplayList();
+     	}
+    }
+
+	//----------------------------------
+	//  constraintRows
+	//----------------------------------
+
+    [ArrayElementType("mx.containers.utilityClasses.ConstraintRow")]
+	[Inspectable(arrayType="mx.containers.utilityClasses.ConstraintRow")]
+
+	/**
+     *  @private
+     *  Storage for the constraintRows property.
+     */
+    private var _constraintRows:Array = [];
+
+	/**
+	 *  @copy mx.containers.utilityClasses.IConstraintLayout#constraintRows
+	 */
+	public function get constraintRows():Array
+    {
+        return _constraintRows;
+    }
+
+    /**
+     *  @private
+     */
+    public function set constraintRows(value:Array):void
+    {
+    	if (value != _constraintRows)
+    	{
+	    	var n:int = value.length;
+	    	for (var i:int = 0; i < n; i++)
+    		{
+    			ConstraintRow(value[i]).container = this;
+    		}
+			_constraintRows = value;
+
+			invalidateSize();
+			invalidateDisplayList();
+     	}
+    }
+
+    //----------------------------------
+    //  controlBar
+    //----------------------------------
+
+    /**
+     *  A reference to this Panel container's control bar, if any.
+     */
+    protected var controlBar:IUIComponent;
+
+    /**
+     *  Proxy to the controlBar property which is protected and can't be accessed externally
+     */
+    mx_internal function get _controlBar():IUIComponent
+    {
+    	return controlBar;
+    }
+
+    //----------------------------------
+    //  fontContext
+    //----------------------------------
+
+    /**
+     *  @inheritDoc
+     */
+    public function get fontContext():IFlexModuleFactory
+    {
+        return moduleFactory;
+    }
+
+    /**
+     *  @private
+     */
+    public function set fontContext(moduleFactory:IFlexModuleFactory):void
+    {
+        this.moduleFactory = moduleFactory;
+    }
+
+    //----------------------------------
+    //  layout
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the layout property.
+     */
+    private var _layout:String = ContainerLayout.VERTICAL;
+
+    [Bindable("layoutChanged")]
+    [Inspectable(category="General", enumeration="vertical,horizontal,absolute", defaultValue="vertical")]
+
+    /**
+     *  Specifies the layout mechanism used for this container.
+     *  Panel containers can use "vertical", "horizontal",
+     *  or "absolute" positioning.
+     *  Vertical positioning lays out the child components vertically from
+     *  the top of the container to the bottom in the specified order.
+     *  Horizontal positioning lays out the child components horizontally
+     *  from the left of the container to the right in the specified order.
+     *  Absolute positioning does no automatic layout and requires you to
+     *  explicitly define the location of each child component.
+     *
+     *  @default "vertical"
+     */
+    public function get layout():String
+    {
+        return _layout;
+    }
+
+    /**
+     *  @private
+     */
+    public function set layout(value:String):void
+    {
+        if (_layout != value)
+        {
+            _layout = value;
+
+            if (layoutObject)
+                // Set target to null for cleanup.
+                layoutObject.target = null;
+
+            if (_layout == ContainerLayout.ABSOLUTE)
+                layoutObject = new CanvasLayout();
+            else
+            {
+                layoutObject = new BoxLayout();
+
+                if (_layout == ContainerLayout.VERTICAL)
+                    BoxLayout(layoutObject).direction
+                        = BoxDirection.VERTICAL;
+                else
+                    BoxLayout(layoutObject).direction
+                        = BoxDirection.HORIZONTAL;
+            }
+
+            if (layoutObject)
+                layoutObject.target = this;
+
+            invalidateSize();
+            invalidateDisplayList();
+
+            dispatchEvent(new Event("layoutChanged"));
+        }
+    }
+
+    //----------------------------------
+    //  status
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the status property.
+     */
+    private var _status:String = "";
+
+    /**
+     *  @private
+     */
+    private var _statusChanged:Boolean = false;
+
+    [Bindable("statusChanged")]
+    [Inspectable(category="General", defaultValue="")]
+
+    /**
+     *  Text in the status area of the title bar.
+     *
+     *  @default ""
+     */
+    public function get status():String
+    {
+        return _status;
+    }
+
+    /**
+     *  @private
+     */
+    public function set status(value:String):void
+    {
+        _status = value;
+        _statusChanged = true;
+
+        invalidateProperties();
+
+        dispatchEvent(new Event("statusChanged"));
+    }
+
+    //----------------------------------
+    //  statusTextField
+    //----------------------------------
+
+    /**
+     *  The UITextField sub-control that displays the status.
+     *  The status field is a child of the titleBar sub-control.
+     *
+     *  @see #titleBar
+     */
+    protected var statusTextField:IUITextField;
+
+    //----------------------------------
+    //  title
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the title property.
+     */
+    private var _title:String = "";
+
+    /**
+     *  @private
+     */
+    private var _titleChanged:Boolean = false;
+
+    [Bindable("titleChanged")]
+    [Inspectable(category="General", defaultValue="")]
+
+    /**
+     *  Title or caption displayed in the title bar.
+     *
+     *  @default ""
+     *
+     *  @tiptext Gets or sets the title/caption displayed in the title bar
+     *  @helpid 3991
+     */
+    public function get title():String
+    {
+        return _title;
+    }
+
+    /**
+     *  @private
+     */
+    public function set title(value:String):void
+    {
+        _title = value;
+        _titleChanged = true;
+
+        invalidateProperties();
+        invalidateSize();
+        invalidateViewMetricsAndPadding();
+
+        dispatchEvent(new Event("titleChanged"));
+    }
+
+    //----------------------------------
+    //  titleBar
+    //----------------------------------
+
+    /**
+     *  The TitleBar sub-control that displays the Panel container's title bar.
+     */
+    protected var titleBar:UIComponent;
+
+    //----------------------------------
+    //  titleIcon
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the titleIcon property.
+     */
+    private var _titleIcon:Class;
+
+    /**
+     *  @private
+     */
+    private var _titleIconChanged:Boolean = false;
+
+    [Bindable("titleIconChanged")]
+    [Inspectable(category="General", defaultValue="", format="EmbeddedFile")]
+
+    /**
+     *  The icon displayed in the title bar.
+     *
+     *  @default null
+     */
+    public function get titleIcon():Class
+    {
+        return _titleIcon;
+    }
+
+    /**
+     *  @private
+     */
+    public function set titleIcon(value:Class):void
+    {
+        _titleIcon = value;
+        _titleIconChanged = true;
+
+        invalidateProperties();
+        invalidateSize();
+
+        dispatchEvent(new Event("titleIconChanged"));
+    }
+
+    //----------------------------------
+    //  titleTextField
+    //----------------------------------
+
+    /**
+     *  The UITextField sub-control that displays the title.
+     *  The title field is a child of the titleBar sub-control.
+     *
+     *  @see #titleBar
+     */
+    protected var titleTextField:IUITextField;
+
+    //----------------------------------
+    //  usePadding
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override mx_internal function get usePadding():Boolean
+    {
+        // We use margins for all layouts except absolute.
+        return layout != ContainerLayout.ABSOLUTE;
+    }
+
+    //----------------------------------
+    //  viewMetrics
+    //----------------------------------
+
+    /**
+     *  @private
+     *
+     *  Returns the thickness of the edges of the object, including
+     *  the border, title bar, and scroll bars, if visible.
+     *  @return Object with left, right, top, and bottom properties
+     *  containing the edge thickness, in pixels.
+     */
+    override public function get viewMetrics():EdgeMetrics
+    {
+    	var vm:EdgeMetrics = super.viewMetrics;
+
+        // The getViewMetrics function needs to return its own object.
+        // Rather than allocating a new one each time, we'll allocate
+        // one once and then hold a pointer to it.
+        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+        {
+	        if (!panelViewMetrics)
+	            panelViewMetrics = new EdgeMetrics(0, 0, 0, 0);
+	        vm = panelViewMetrics;
+
+	        var o:EdgeMetrics = super.viewMetrics;
+	        var bt:Number = getStyle("borderThickness");
+	        var btl:Number = getStyle("borderThicknessLeft");
+	        var btt:Number = getStyle("borderThicknessTop");
+	        var btr:Number = getStyle("borderThicknessRight");
+	        var btb:Number = getStyle("borderThicknessBottom");
+
+	        // Add extra space to edges (was margins).
+	        vm.left = o.left + (isNaN(btl) ? bt : btl);
+	        vm.top = o.top + (isNaN(btt) ? bt : btt);
+	        vm.right = o.right + (isNaN(btr) ? bt : btr);
+	        // Bottom is a special case. If borderThicknessBottom is NaN,
+	        // use btl if we don't have a control bar or btt if we do.
+	        vm.bottom = o.bottom + (isNaN(btb) ?
+	            (controlBar && !isNaN(btt) ? btt : isNaN(btl) ? bt : btl) :
+	            btb);
+
+	        // Since the header covers the solid portion of the border,
+	        // we need to use the larger of borderThickness or headerHeight
+	        var hHeight:Number = getHeaderHeight();
+	        if (!isNaN(hHeight))
+	            vm.top += hHeight;
+
+	        if (controlBar && controlBar.includeInLayout)
+	            vm.bottom += controlBar.getExplicitOrMeasuredHeight();
+        }
+        return vm;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: DisplayObjectContainer
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function getChildIndex(child:DisplayObject):int
+    {
+        // This override of getChildIndex() fixes a bug #116637.
+        // The FocusManager incorrectly calls this function for the controlBar
+        // with isContentAPI as true.  But it's really our fault, because we
+        // first add the controlBar as a child (so it gets into the
+        // FocusManager's list of focusable objects) and then abduct it.  This,
+        // in combination with the contentPane, leads to a runtime error.
+        // Simply returning numChildren (meaning "after last child") is
+        // harmless and resolves the issue.
+        if (controlBar && child == controlBar)
+            return numChildren;
+        else
+            return super.getChildIndex(child);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function initializeAccessibility():void
+    {
+        if (Panel.createAccessibilityImplementation != null)
+            Panel.createAccessibilityImplementation(this);
+    }
+
+    /**
+     *  @private
+     *  Create child objects.
+     */
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        // Create the title bar over the top of the floating border.
+        if (!titleBar)
+        {
+            titleBar = new UIComponent();
+            titleBar.visible = false;
+
+            titleBar.addEventListener(MouseEvent.MOUSE_DOWN,
+                                      titleBar_mouseDownHandler);
+
+            rawChildren.addChild(titleBar);
+        }
+
+        // Create the titleBarBackground as a child of the titleBar.
+        if (!titleBarBackground)
+        {
+            var titleBarBackgroundClass:Class =
+                getStyle("titleBackgroundSkin");
+            if (titleBarBackgroundClass)
+            {
+                titleBarBackground = new titleBarBackgroundClass();
+
+                var backgroundUIComponent:IStyleClient =
+                    titleBarBackground as IStyleClient;
+                if (backgroundUIComponent)
+                {
+                    backgroundUIComponent.setStyle("backgroundImage",
+                                                   undefined);
+                }
+
+                var backgroundStyleable:ISimpleStyleClient =
+                    titleBarBackground as ISimpleStyleClient;
+                if (backgroundStyleable)
+                    backgroundStyleable.styleName = this;
+
+                titleBar.addChild(DisplayObject(titleBarBackground));
+            }
+        }
+
+        createTitleTextField(-1);
+        createStatusTextField(-1);
+
+        // Create the closeButton as a child of the titleBar.
+        if (!closeButton)
+        {
+            closeButton = new Button();
+            closeButton.styleName = new StyleProxy(this, closeButtonStyleFilters);
+
+            closeButton.upSkinName = "closeButtonUpSkin";
+            closeButton.overSkinName = "closeButtonOverSkin";
+            closeButton.downSkinName = "closeButtonDownSkin";
+            closeButton.disabledSkinName = "closeButtonDisabledSkin";
+            closeButton.skinName = "closeButtonSkin";
+            closeButton.explicitWidth = closeButton.explicitHeight = 16;
+
+            closeButton.focusEnabled = false;
+            closeButton.visible = false;
+            closeButton.enabled = enabled;
+
+            closeButton.addEventListener(MouseEvent.CLICK,
+                                          closeButton_clickHandler);
+
+            // Add the close button on top of the title/status.
+            titleBar.addChild(closeButton);
+			closeButton.owner = this;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (hasFontContextChanged())
+        {
+            // Re-create the text fields in case the new font
+            // is in a  different SWF then the current one.
+            var childIndex:int;
+            if (titleTextField)
+            {
+                childIndex = titleBar.getChildIndex(DisplayObject(titleTextField));
+                removeTitleTextField();
+                createTitleTextField(childIndex);
+
+                _titleChanged = true;
+            }
+
+            if (statusTextField)
+            {
+                childIndex = titleBar.getChildIndex(DisplayObject(statusTextField));
+                removeStatusTextField();
+                createStatusTextField(childIndex);
+
+                _statusChanged = true;
+            }
+        }
+
+        if (_titleChanged)
+        {
+            _titleChanged = false;
+            titleTextField.text = _title;
+
+            // Don't call layoutChrome() if we  haven't initialized,
+            // because it causes commit/measure/layout ordering problems
+            // for children of the control bar.
+            if (initialized)
+                layoutChrome(unscaledWidth, unscaledHeight);
+        }
+
+        if (_titleIconChanged)
+        {
+            _titleIconChanged = false;
+
+            if (titleIconObject)
+            {
+                titleBar.removeChild(DisplayObject(titleIconObject));
+                titleIconObject = null;
+            }
+
+            if (_titleIcon)
+            {
+                titleIconObject = new _titleIcon();
+                titleBar.addChild(DisplayObject(titleIconObject));
+            }
+
+            // Don't call layoutChrome() if we  haven't initialized,
+            // because it causes commit/measure/layout ordering problems
+            // for children of the control bar.
+            if (initialized)
+                layoutChrome(unscaledWidth, unscaledHeight);
+        }
+
+        if (_statusChanged)
+        {
+            _statusChanged = false;
+            statusTextField.text = _status;
+
+            // Don't call layoutChrome() if we  haven't initialized,
+            // because it causes commit/measure/layout ordering problems
+            // for children of the control bar.
+            if (initialized)
+                layoutChrome(unscaledWidth, unscaledHeight);
+        }
+    }
+
+    /**
+     *  Calculates the default mininum and maximum sizes
+     *  of the Panel container.
+     *  For more information
+     *  about the measure() method, see the
+     *  UIComponent.measure() method.
+     *
+     *
The measure() method first calls
+     *  VBox.measure() method, and then ensures that the
+     *  measuredWidth and
+     *  measuredMinWidth properties are wide enough
+     *  to display the title and the ControlBar.

+     *
+     *  @see mx.core.UIComponent#measure()
+     */
+    override protected function measure():void
+    {
+        super.measure();
+
+        layoutObject.measure();
+
+        var textSize:Rectangle = measureHeaderText();
+        var textWidth:Number = textSize.width;
+        var textHeight:Number = textSize.height;
+
+        var bm:EdgeMetrics =
+        	FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
+        	borderMetrics :
+        	EdgeMetrics.EMPTY;
+        textWidth += bm.left + bm.right;
+
+        var offset:Number = 5;
+        textWidth += offset * 2;
+
+        if (titleIconObject)
+            textWidth += titleIconObject.width;
+
+        if (closeButton)
+            textWidth += closeButton.getExplicitOrMeasuredWidth() + 6;
+
+        measuredMinWidth = Math.max(textWidth, measuredMinWidth);
+        measuredWidth = Math.max(textWidth, measuredWidth);
+
+        if (controlBar && controlBar.includeInLayout)
+        {
+            var controlWidth:Number = controlBar.getExplicitOrMeasuredWidth() +
+                                      bm.left + bm.right;
+
+            measuredWidth =
+                Math.max(measuredWidth, controlWidth);
+        }
+    }
+
+    /**
+     *  @private
+     *  Draw by making everything visible, then laying out.
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        layoutObject.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        if (border)
+        	border.visible = true;
+        titleBar.visible = true;
+    }
+
+    /**
+     *  @private
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+        super.styleChanged(styleProp);
+
+        if (allStyles || styleProp == "titleStyleName")
+        {
+            if (titleTextField)
+            {
+                var titleStyleName:String = getStyle("titleStyleName");
+                titleTextField.styleName = titleStyleName;
+            }
+        }
+
+        if (allStyles || styleProp == "statusStyleName")
+        {
+            if (statusTextField)
+            {
+                var statusStyleName:String = getStyle("statusStyleName");
+                statusTextField.styleName = statusStyleName;
+            }
+        }
+
+        if (allStyles || styleProp == "controlBarStyleName")
+        {
+            if (controlBar && controlBar is ISimpleStyleClient)
+            {
+                var controlBarStyleName:String = getStyle("controlBarStyleName");
+                ISimpleStyleClient(controlBar).styleName = controlBarStyleName;
+            }
+        }
+
+        if (allStyles || styleProp == "titleBackgroundSkin")
+        {
+            if (titleBar)
+            {
+                var titleBackgroundSkinClass:Class =
+                    getStyle("titleBackgroundSkin");
+
+                if (titleBackgroundSkinClass)
+                {
+                    // Remove existing background
+                    if (titleBarBackground)
+                    {
+                        titleBar.removeChild(DisplayObject(titleBarBackground));
+                        titleBarBackground = null;
+                    }
+
+                    titleBarBackground = new titleBackgroundSkinClass();
+
+                    var backgroundUIComponent:IStyleClient =
+                        titleBarBackground as IStyleClient;
+                    if (backgroundUIComponent)
+                    {
+                        backgroundUIComponent.setStyle("backgroundImage",
+                                                       undefined);
+                    }
+
+                var backgroundStyleable:ISimpleStyleClient =
+                    titleBarBackground as ISimpleStyleClient;
+                if (backgroundStyleable)
+                    backgroundStyleable.styleName = this;
+
+                    titleBar.addChildAt(DisplayObject(titleBarBackground), 0);
+                }
+            }
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: Container
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function layoutChrome(unscaledWidth:Number,
+                                             unscaledHeight:Number):void
+    {
+        super.layoutChrome(unscaledWidth, unscaledHeight);
+
+        // Remove the borderThickness from the border metrics,
+        // since the header and control bar overlap any solid border.
+        var bm:EdgeMetrics =
+        	FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
+        	borderMetrics :
+        	EdgeMetrics.EMPTY;
+
+        var x:Number = bm.left;
+        var y:Number = bm.top;
+
+        var headerHeight:Number = getHeaderHeight();
+        if (headerHeight > 0 && height >= headerHeight)
+        {
+            var titleBarWidth:Number = unscaledWidth - bm.left - bm.right;
+
+            showTitleBar(true);
+            titleBar.mouseChildren = true;
+            titleBar.mouseEnabled = true;
+
+            // Draw an invisible rect in the tileBar. This ensures we
+            // will get clicks, even if the background is transparent
+            // and there is no title.
+            var g:Graphics = titleBar.graphics;
+            g.clear();
+            g.beginFill(0xFFFFFF, 0);
+            g.drawRect(0, 0, titleBarWidth, headerHeight);
+            g.endFill();
+
+            // Position the titleBar.
+            titleBar.move(x, y);
+            titleBar.setActualSize(titleBarWidth, headerHeight);
+
+            // Position the titleBarBackground within the titleBar.
+            titleBarBackground.move(0, 0);
+            IFlexDisplayObject(titleBarBackground).setActualSize(
+                titleBarWidth, headerHeight);
+
+            // Set the close button next to the upper-right corner,
+            // offset by the border thickness.
+            closeButton.visible = _showCloseButton;
+            if (_showCloseButton)
+            {
+                closeButton.setActualSize(
+                    closeButton.getExplicitOrMeasuredWidth(),
+                    closeButton.getExplicitOrMeasuredHeight());
+
+                closeButton.move(
+                    unscaledWidth - x - bm.right - 10 -
+                    closeButton.getExplicitOrMeasuredWidth(),
+                    (headerHeight -
+                    closeButton.getExplicitOrMeasuredHeight()) / 2);
+            }
+
+            var leftOffset:Number = 10;
+            var rightOffset:Number = 10;
+            var h:Number;
+            var offset:Number;
+
+            // Set the position of the title icon.
+            if (titleIconObject)
+            {
+                h = titleIconObject.height;
+                offset = (headerHeight - h) / 2;
+                titleIconObject.move(leftOffset, offset);
+                leftOffset += titleIconObject.width + 4;
+            }
+
+            // Set the position of the title text.
+            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+            	h = titleTextField.nonZeroTextHeight;
+            else
+            	h = titleTextField.getUITextFormat().measureText(titleTextField.text).height;
+            offset = (headerHeight - h) / 2;
+
+            var borderWidth:Number = bm.left + bm.right;
+            titleTextField.move(leftOffset, offset - 1);
+            titleTextField.setActualSize(Math.max(0,
+                                   unscaledWidth - leftOffset -
+                                   rightOffset - borderWidth),
+                                   h + UITextField.TEXT_HEIGHT_PADDING);
+
+            // Set the position of the status text.
+            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
+            	h = statusTextField.textHeight;
+            else
+            	h = statusTextField.text != "" ? statusTextField.getUITextFormat().measureText(statusTextField.text).height : 0;
+            offset = (headerHeight - h) / 2;
+            var statusX:Number = unscaledWidth - rightOffset - 4 -
+                                 borderWidth - statusTextField.textWidth;
+            if (_showCloseButton)
+                statusX -= (closeButton.getExplicitOrMeasuredWidth() + 4);
+            statusTextField.move(statusX, offset - 1);
+            statusTextField.setActualSize(
+            	statusTextField.textWidth + 8,
+                statusTextField.textHeight + UITextField.TEXT_HEIGHT_PADDING);
+
+            // Make sure the status text isn't too long.
+            // We do simple clipping here.
+            var minX:Number = titleTextField.x + titleTextField.textWidth + 8;
+            if (statusTextField.x < minX)
+            {
+                // Show as much as we can.
+                statusTextField.width = Math.max(statusTextField.width -
+                                        (minX - statusTextField.x), 0);
+                statusTextField.x = minX;
+            }
+        }
+        else
+        {
+            if (titleBar)
+            {
+                showTitleBar(false);
+                titleBar.mouseChildren = false;
+                titleBar.mouseEnabled = false;
+            }
+        }
+
+        if (controlBar)
+        {
+            var cx:Number = controlBar.x;
+            var cy:Number = controlBar.y;
+            var cw:Number = controlBar.width;
+            var ch:Number = controlBar.height;
+
+            controlBar.setActualSize(
+                unscaledWidth - (bm.left + bm.right),
+                controlBar.getExplicitOrMeasuredHeight());
+
+            controlBar.move(
+                bm.left,
+                unscaledHeight - bm.bottom -
+                controlBar.getExplicitOrMeasuredHeight());
+
+            if (controlBar.includeInLayout)
+                // Hide the control bar if it is spilling out.
+                controlBar.visible = controlBar.y >= bm.top;
+
+            // If the control bar's position or size changed, redraw.  This
+            // fixes a refresh bug (when the control bar vacates some space,
+            // the new space appears blank).
+            if (cx != controlBar.x ||
+                cy != controlBar.y ||
+                cw != controlBar.width ||
+                ch != controlBar.height)
+            {
+                invalidateDisplayList();
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override public function createComponentsFromDescriptors(
+                                recurse:Boolean = true):void
+    {
+        super.createComponentsFromDescriptors();
+
+        if (numChildren == 0)
+        {
+            setControlBar(null);
+            return;
+        }
+
+        // If the last content child is a ControlBar, change it
+        // from being a content child to a chrome child;
+        // i.e., move it to the rawChildren collection.
+        var lastChild:IUIComponent = IUIComponent(getChildAt(numChildren - 1));
+        if (lastChild is ControlBar)
+        {
+        	var oldChildDocument:Object = lastChild.document;
+
+            if (contentPane)
+            {
+                contentPane.removeChild(DisplayObject(lastChild));
+            }
+            else
+            {
+                removeChild(DisplayObject(lastChild));
+            }
+            // Restore the original document. Otherwise, when we re-add the child when the Panel is
+            // a custom component, the child will use the custom component as the document instead of
+            // using the document in which the child was declared.
+            lastChild.document = oldChildDocument;
+            rawChildren.addChild(DisplayObject(lastChild));
+            setControlBar(lastChild);
+        }
+        else
+        {
+            setControlBar(null);
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+	 *  Creates the title text field child
+     *  and adds it as a child of this component.
+     *
+     *  @param childIndex The index of where to add the child.
+     *  If -1, the text field is appended to the end of the list.
+     */
+    mx_internal function createTitleTextField(childIndex:int):void
+    {
+        // Create the titleTextField as a child of the titleBar.
+        if (!titleTextField)
+        {
+            titleTextField = IUITextField(createInFontContext(UITextField));
+            titleTextField.selectable = false;
+
+            if (childIndex == -1)
+                titleBar.addChild(DisplayObject(titleTextField));
+            else
+				titleBar.addChildAt(DisplayObject(titleTextField), childIndex);
+
+            var titleStyleName:String = getStyle("titleStyleName");
+            titleTextField.styleName = titleStyleName;
+            titleTextField.text = title;
+            titleTextField.enabled = enabled;
+        }
+    }
+
+    /**
+     *  @private
+     *  Removes the title text field from this component.
+     */
+    mx_internal function removeTitleTextField():void
+    {
+        if (titleBar && titleTextField)
+        {
+            titleBar.removeChild(DisplayObject(titleTextField));
+            titleTextField = null;
+        }
+    }
+
+    /**
+     *  @private
+     *  Creates the status text field child
+     *  and adds it as a child of this component.
+     *
+     *  @param childIndex The index of where to add the child.
+     *  If -1, the text field is appended to the end of the list.
+     */
+    mx_internal function createStatusTextField(childIndex:int):void
+    {
+        // Create the statusTextField as a child of the titleBar.
+        if (titleBar && !statusTextField)
+        {
+            statusTextField = IUITextField(createInFontContext(UITextField));
+            statusTextField.selectable = false;
+
+            if (childIndex == -1)
+                titleBar.addChild(DisplayObject(statusTextField));
+            else
+                titleBar.addChildAt(DisplayObject(statusTextField), childIndex);
+
+            var statusStyleName:String = getStyle("statusStyleName");
+            statusTextField.styleName = statusStyleName;
+            statusTextField.text = status;
+            statusTextField.enabled = enabled;
+        }
+    }
+
+    /**
+     *  @private
+     *  Removes the status text field from this component.
+     */
+    mx_internal function removeStatusTextField():void
+    {
+        if (titleBar && statusTextField)
+        {
+            titleBar.removeChild(DisplayObject(statusTextField));
+            statusTextField = null;
+        }
+    }
+
+    /**
+     *  @private.
+	 *  Returns a Rectangle containing the largest piece of header
+     *  text (can be either the title or status, whichever is bigger).
+     */
+    private function measureHeaderText():Rectangle
+    {
+        var textWidth:Number = 20;
+        var textHeight:Number = 14;
+
+		var textFormat:UITextFormat;
+		var metrics:TextLineMetrics;
+
+        if (titleTextField && titleTextField.text)
+        {
+            titleTextField.validateNow();
+			textFormat = titleTextField.getUITextFormat();
+        	metrics = textFormat.measureText(titleTextField.text, false);
+            textWidth = metrics.width;
+            textHeight = metrics.height;
+        }
+
+        if (statusTextField && statusTextField.text)
+        {
+            statusTextField.validateNow();
+			textFormat = statusTextField.getUITextFormat();
+            metrics = textFormat.measureText(statusTextField.text, false);
+            textWidth = Math.max(textWidth, metrics.width);
+            textHeight = Math.max(textHeight, metrics.height);
+        }
+
+        return new Rectangle(0, 0, Math.round(textWidth), Math.round(textHeight));
+    }
+
+    /**
+     *  Returns the height of the header.
+     */
+    protected function getHeaderHeight():Number
+    {
+        var headerHeight:Number = getStyle("headerHeight");
+
+        if (isNaN(headerHeight))
+            headerHeight = measureHeaderText().height + HEADER_PADDING;
+
+        return headerHeight;
+    }
+
+    /**
+     *  @private
+     *  Proxy to getHeaderHeight() for PanelSkin
+	 *  since we can't change its function signature
+     */
+    mx_internal function getHeaderHeightProxy():Number
+    {
+    	return getHeaderHeight();
+    }
+
+    /**
+     *  @private
+     */
+    private function showTitleBar(show:Boolean):void
+    {
+        titleBar.visible = show;
+
+        var n:int = titleBar.numChildren;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:DisplayObject = titleBar.getChildAt(i);
+            child.visible = show;
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function setControlBar(newControlBar:IUIComponent):void
+    {
+        if (newControlBar == controlBar)
+            return;
+
+        controlBar = newControlBar;
+
+		// If roundedBottomCorners is set locally, don't auto-set
+		// it when the controlbar is added/removed.
+		if (!checkedForAutoSetRoundedCorners)
+		{
+			checkedForAutoSetRoundedCorners = true;
+			autoSetRoundedCorners = styleDeclaration ?
+					styleDeclaration.getStyle("roundedBottomCorners") === undefined :
+					true;
+		}
+
+		if (autoSetRoundedCorners)
+        	setStyle("roundedBottomCorners", controlBar != null);
+
+        var controlBarStyleName:String = getStyle("controlBarStyleName");
+
+        if (controlBarStyleName && controlBar is ISimpleStyleClient)
+            ISimpleStyleClient(controlBar).styleName = controlBarStyleName;
+
+        if (controlBar)
+            controlBar.enabled = enabled;
+        if (controlBar is IAutomationObject)
+            IAutomationObject(controlBar).showInAutomationHierarchy = false;
+
+        invalidateViewMetricsAndPadding();
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    /**
+     *  Called when the user starts dragging a Panel
+     *  that has been popped up by the PopUpManager.
+     */
+    protected function startDragging(event:MouseEvent):void
+    {
+        regX = event.stageX - x;
+        regY = event.stageY - y;
+
+        systemManager.addEventListener(
+            MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true);
+
+        systemManager.addEventListener(
+            MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
+
+        systemManager.stage.addEventListener(
+            Event.MOUSE_LEAVE, stage_mouseLeaveHandler);
+    }
+
+    /**
+     *  Called when the user stops dragging a Panel
+     *  that has been popped up by the PopUpManager.
+     */
+    protected function stopDragging():void
+    {
+        systemManager.removeEventListener(
+            MouseEvent.MOUSE_MOVE, systemManager_mouseMoveHandler, true);
+
+        systemManager.removeEventListener(
+            MouseEvent.MOUSE_UP, systemManager_mouseUpHandler, true);
+
+        systemManager.stage.removeEventListener(
+            Event.MOUSE_LEAVE, stage_mouseLeaveHandler);
+
+        regX = NaN;
+        regY = NaN;
+    }
+
+    /**
+     *  @private
+     *  Some other components which use a Panel as an internal
+     *  subcomponent need access to the title bar,
+     *  but can't access the titleBar var because it is protected
+     *  and therefore available only to subclasses.
+     */
+    mx_internal function getTitleBar():UIComponent
+    {
+        return titleBar;
+    }
+
+    /**
+     *  @private
+     *  Some other components which use a Panel as an internal
+     *  subcomponent need access to the UITextField that displays the title,
+     *  but can't access the titleTextField var because it is protected
+     *  and therefore available only to subclasses.
+     */
+    mx_internal function getTitleTextField():IUITextField
+    {
+        return titleTextField;
+    }
+
+    /**
+     *  @private
+     *  Some other components which use a Panel as an internal
+     *  subcomponent need access to the UITextField that displays the status,
+     *  but can't access the statusTextField var because it is protected
+     *  and therefore available only to subclasses.
+     */
+    mx_internal function getStatusTextField():IUITextField
+    {
+        return statusTextField;
+    }
+
+    /**
+     *  @private
+     *  Some other components which use a Panel as an internal
+     *  subcomponent need access to the control bar,
+     *  but can't access the controlBar var because it is protected
+     *  and therefore available only to subclasses.
+     */
+    mx_internal function getControlBar():IUIComponent
+    {
+        return controlBar;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function titleBar_mouseDownHandler(event:MouseEvent):void
+    {
+        // A mouseDown on the closeButton will bubble up to the titleBar,
+        // but it shouldn't start a drag; it should simply start the
+        // normal mouse/Button interaction.
+        if (event.target == closeButton)
+            return;
+
+        if (enabled && isPopUp && isNaN(regX))
+            startDragging(event);
+    }
+
+    /**
+     *  @private
+     */
+    private function systemManager_mouseMoveHandler(event:MouseEvent):void
+    {
+    	// during a drag, only the Panel should get mouse move events
+    	// (e.g., prevent objects 'beneath' it from getting them -- see bug 187569)
+    	// we don't check the target since this is on the systemManager and the target
+    	// changes a lot -- but this listener only exists during a drag.
+    	event.stopImmediatePropagation();
+
+        move(event.stageX - regX, event.stageY - regY);
+    }
+
+    /**
+     *  @private
+     */
+    private function systemManager_mouseUpHandler(event:MouseEvent):void
+    {
+        if (!isNaN(regX))
+            stopDragging();
+    }
+
+    /**
+     *  @private
+     */
+    private function stage_mouseLeaveHandler(event:Event):void
+    {
+        if (!isNaN(regX))
+            stopDragging();
+    }
+
+    /**
+     *  @private
+     */
+    private function closeButton_clickHandler(event:MouseEvent):void
+    {
+        dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
+    }
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10464
Author:   rfrishbe@adobe.com
Date:     2009-09-21T17:40:30.663638Z

Log Message:
-----------
Removing support in Flex framework for compatibility version < 3.  We won't support compatibility-version 2 or 2.01 anymore.  We only keep compatibility-version for one full release, so for Flex 4, we only support compatibility-version = 3.x.

This should reduce our code-size some as we no longer need this old code.  I didn't clean up the compiler's support for compatibility-versioning as it didn't seem worth the effort.

QE notes: -
Doc notes: -
Bugs: SDK-15360
Reviewer: Kevin
Tests run: checkintests, Joan ran all mustella tests
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/TileListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/HaloBorder.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/accordionClasses/AccordionHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/CanvasLayout.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UITLFTextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/AccordionHeaderSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Alert.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NavBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridHeaderBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/treeClasses/TreeItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/TabNavigator.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/FormItem.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/controls/dataGridClasses/DataGridHeader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/DateChooserYearArrowSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/MenuBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuBarItem.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/PanelSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/menuClasses/MenuItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Accordion.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProtoChain.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/skins/halo/ScrollTrackSkin.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/utilityClasses/Flex.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/LinkBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>

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

--- frameworks/projects/mx/src/mx/containers/Panel.as
+++ frameworks/projects/mx/src/mx/containers/Panel.as
@@ -32,7 +32,6 @@
 import mx.core.ContainerLayout;
 import mx.core.EdgeMetrics;
 import mx.core.EventPriority;
-import mx.core.FlexVersion;
 import mx.core.IFlexDisplayObject;
 import mx.core.IFlexModuleFactory;
 import mx.core.IFontContextComponent;
@@ -630,9 +629,6 @@
      */
     override public function get baselinePosition():Number
     {
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-            return super.baselinePosition;
-
         if (!validateBaselinePosition())
             return NaN;

@@ -1146,56 +1142,6 @@
     //----------------------------------
     //  viewMetrics
     //----------------------------------
-
-    /**
-     *  @private
-     *
-     *  Returns the thickness of the edges of the object, including
-     *  the border, title bar, and scroll bars, if visible.
-     *  @return Object with left, right, top, and bottom properties
-     *  containing the edge thickness, in pixels.
-     */
-    override public function get viewMetrics():EdgeMetrics
-    {
-        var vm:EdgeMetrics = super.viewMetrics;
-
-        // The getViewMetrics function needs to return its own object.
-        // Rather than allocating a new one each time, we'll allocate
-        // one once and then hold a pointer to it.
-        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-        {
-            if (!panelViewMetrics)
-                panelViewMetrics = new EdgeMetrics(0, 0, 0, 0);
-            vm = panelViewMetrics;
-
-            var o:EdgeMetrics = super.viewMetrics;
-            var bt:Number = getStyle("borderThickness");
-            var btl:Number = getStyle("borderThicknessLeft");
-            var btt:Number = getStyle("borderThicknessTop");
-            var btr:Number = getStyle("borderThicknessRight");
-            var btb:Number = getStyle("borderThicknessBottom");
-
-            // Add extra space to edges (was margins).
-            vm.left = o.left + (isNaN(btl) ? bt : btl);
-            vm.top = o.top + (isNaN(btt) ? bt : btt);
-            vm.right = o.right + (isNaN(btr) ? bt : btr);
-            // Bottom is a special case. If borderThicknessBottom is NaN,
-            // use btl if we don't have a control bar or btt if we do.
-            vm.bottom = o.bottom + (isNaN(btb) ?
-                (controlBar && !isNaN(btt) ? btt : isNaN(btl) ? bt : btl) :
-                btb);
-
-            // Since the header covers the solid portion of the border,
-            // we need to use the larger of borderThickness or headerHeight
-            var hHeight:Number = getHeaderHeight();
-            if (!isNaN(hHeight))
-                vm.top += hHeight;
-
-            if (controlBar && controlBar.includeInLayout)
-                vm.bottom += controlBar.getExplicitOrMeasuredHeight();
-        }
-        return vm;
-    }

     //--------------------------------------------------------------------------
     //
@@ -1421,10 +1367,7 @@
         var textWidth:Number = textSize.width;
         var textHeight:Number = textSize.height;

-        var bm:EdgeMetrics =
-            FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
-            borderMetrics :
-            EdgeMetrics.EMPTY;
+        var bm:EdgeMetrics = EdgeMetrics.EMPTY;
         textWidth += bm.left + bm.right;

         var offset:Number = 5;
@@ -1566,10 +1509,7 @@

         // Remove the borderThickness from the border metrics,
         // since the header and control bar overlap any solid border.
-        var bm:EdgeMetrics =
-            FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0 ?
-            borderMetrics :
-            em;
+        var bm:EdgeMetrics = em;

         var x:Number = bm.left;
         var y:Number = bm.top;
@@ -1651,10 +1591,7 @@
             }

             // Set the position of the title text.
-            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-                h = titleTextField.nonZeroTextHeight;
-            else
-                h = titleTextField.getUITextFormat().measureText(titleTextField.text).height;
+            h = titleTextField.getUITextFormat().measureText(titleTextField.text).height;
             offset = (headerHeight - h) / 2;

             var borderWidth:Number = bm.left + bm.right;
@@ -1665,10 +1602,7 @@
                                    h + UITextField.TEXT_HEIGHT_PADDING);

             // Set the position of the status text.
-            if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)
-                h = statusTextField.textHeight;
-            else
-                h = statusTextField.text != "" ? statusTextField.getUITextFormat().measureText(statusTextField.text).height : 0;
+            h = statusTextField.text != "" ? statusTextField.getUITextFormat().measureText(statusTextField.text).height : 0;
             offset = (headerHeight - h) / 2;
             var statusX:Number = unscaledWidth - rightOffset - 4 -
                                  borderWidth - statusTextField.textWidth;


Code formatting. Use node pointer in compare instead of node id.

--- bin/Data/Scripts/Editor/EditorSpawn.as
+++ bin/Data/Scripts/Editor/EditorSpawn.as
@@ -352,9 +352,9 @@
         {
             RayQueryResult result = results[0];

-            for(int i=0; i<results.length; i++)
-            {
-                if (results[i].node.id == node.id)
+            for(uint i = 0; i < results.length; i++)
+            {
+                if (results[i].node is node)
                 {
                     result = results[i];
                     break;
@@ -376,10 +376,10 @@

                 result = randomResults[0];

-                // find node in results
-                for(int i=0; i<randomResults.length; i++)
+                // Find node in results
+                for(uint i = 0; i < randomResults.length; i++)
                 {
-                    if (randomResults[i].node.id == node.id)
+                    if (randomResults[i].node is node)
                     {
                         result = randomResults[i];
                         break;


Transferred from the Adobe Open Source Subversion Repository

Revision: 12068
Author:   jszeto@adobe.com
Date:     2009-11-20T23:12:16.551186Z

Log Message:
-----------
Renaming Border to BorderContainer and BorderSkin to BorderContainerSkin

Updated the files, stylesheet, manifest file and the basicTest tests.

QE notes: tests need updating
Doc notes: Docs need updating
Bugs: SDK-24300
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: Yes. Tests and tools will be impacted.

Modified Paths:
--------------
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/BorderSkin.as" copyfrom-rev="12021" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/BorderContainerSkin.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/BorderTestScript.mxml" copyfrom-rev="12021" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/BorderContainerTestScript.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/tests/basicTests/spark/views/BorderTests.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/SparkClasses.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/tests/basicTests/spark/views/BorderTests.mxml" copyfrom-rev="12021" action="A">/flex/sdk/trunk/frameworks/tests/basicTests/spark/views/BorderContainerTests.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/BorderExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Border.as</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/BorderExample.mxml" copyfrom-rev="12021" action="A">/flex/sdk/trunk/frameworks/projects/spark/asdoc/en_US/spark/components/examples/BorderContainerExample.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Border.as" copyfrom-rev="12021" action="A">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/BorderContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/spark/src/spark/skins/spark/BorderSkin.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/tests/basicTests/spark/scripts/BorderTestScript.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/tests/basicTests/BasicTests-config.xml</path>

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

--- frameworks/projects/spark/src/SparkClasses.as
+++ frameworks/projects/spark/src/SparkClasses.as
@@ -29,7 +29,7 @@
 import spark.core.SpriteVisualElement; SpriteVisualElement;
 import spark.components.supportClasses.ListItemDragProxy; ListItemDragProxy;
 import spark.skins.spark.ApplicationSkin; ApplicationSkin;
-import spark.skins.spark.BorderSkin; BorderSkin;
+import spark.skins.spark.BorderContainerSkin; BorderContainerSkin;
 import spark.skins.spark.ButtonSkin; ButtonSkin;
 import spark.skins.spark.DefaultButtonSkin; DefaultButtonSkin;
 import spark.skins.spark.ButtonBarSkin; ButtonBarSkin;


gettimestr命令およびgetdatestr命令を修正（strf関数の変更に対応）

git-svn-id: 667ccd08e5f160307f6512a0947301cac150914e@110 ceb3ebad-0e53-d446-8596-a45b2b8d79cd


Set redundantStreamId() setter argument as an int

It fixes compilation warnings when Flashls is imported with sources.
Occurs when using mxmlc strict mode (-strict).

--- src/org/mangui/hls/model/Level.as
+++ src/org/mangui/hls/model/Level.as
@@ -70,7 +70,7 @@
         }

         // when switching to a redundant stream, reset fragments. they will be retrieved from new playlist
-        public function set redundantStreamId(id) : void {
+        public function set redundantStreamId(id : int) : void {
             if(id < urls.length && id != _redundantStreamId) {
                 _redundantStreamId = id;
                 fragments = new Vector.<Fragment>();


hiding r text editor by default

hiding r text editor by default

Change-Id: If26f3e964503a4f474aff09859c770ed7cd89edf

--- WeaveUISpark/src/weave/WeaveProperties.as
+++ WeaveUISpark/src/weave/WeaveProperties.as
@@ -104,6 +104,7 @@
 			_toggleToolsMenuItem("CustomGraphicsTool", false);
 			_toggleToolsMenuItem("DataStatisticsTool", false);
 			_toggleToolsMenuItem("RamachandranPlotTool", false);
+			_toggleToolsMenuItem("RTextEditor", false);
 			_toggleToolsMenuItem("SchafersMissingDataTool", false);
 			_toggleToolsMenuItem("DataFilter", false);
 			_toggleToolsMenuItem("KeyMappingTool", false);


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

--- frameworks/projects/charts/src/mx/charts/HLOCChart.as
+++ frameworks/projects/charts/src/mx/charts/HLOCChart.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
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

 package mx.rpc.wsdl
 {


HGIMG4ツールの更新 hspmucomの更新

HGIMG4ツールの更新
hspmucomの更新

git-svn-id: 667ccd08e5f160307f6512a0947301cac150914e@1046 ceb3ebad-0e53-d446-8596-a45b2b8d79cd

--- package/win32/hspsdk/hgimg4/mod_gpmaterial.as
+++ package/win32/hspsdk/hgimg4/mod_gpmaterial.as
@@ -504,12 +504,13 @@
 	if _p1="DST_COLOR" : return 5
 	if _p1="ONE_MINUS_DST_COLOR" : return 6
 	if _p1="SRC_ALPHA" : return 7
-	if _p1="ONE_MINUS_DST_ALPHA" : return 8
-	if _p1="CONSTANT_ALPHA" : return 9
-	if _p1="ONE_MINUS_CONSTANT_ALPHA" : return 10
-	if _p1="SRC_ALPHA_SATURATE" : return 11
+	if _p1="ONE_MINUS_SRC_ALPHA" : return 8
+	if _p1="DST_ALPHA" : return 9
+	if _p1="ONE_MINUS_DST_ALPHA" : return 10
+	if _p1="CONSTANT_ALPHA" : return 11
+	if _p1="ONE_MINUS_CONSTANT_ALPHA" : return 12
+	if _p1="SRC_ALPHA_SATURATE" : return 13
 	return 0
-

 #deffunc matgui_apply

@@ -564,8 +565,6 @@
 	selstr_filter = "\nNEAREST\nLINEAR\nNEAREST_MIPMAP_NEAREST\nLINEAR_MIPMAP_NEAREST\nNEAREST_MIPMAP_LINEAR\nLINEAR_MIPMAP_LINEAR"
 	selstr_dfunc = "\nNEVER\nLESS\nEQUAL\nLEQUAL\nGREATER\nNOTEQUAL\nGEQUAL\nALWAYS"
 	selstr_blend = "\nZERO\nONE\nSRC_COLOR\nONE_MINUS_SRC_COLOR\nDST_COLOR\nONE_MINUS_DST_COLOR\nSRC_ALPHA\nONE_MINUS_SRC_ALPHA\nDST_ALPHA\nONE_MINUS_DST_ALPHA\nCONSTANT_ALPHA\nONE_MINUS_CONSTANT_ALPHA\nSRC_ALPHA_SATURATE"
-
-

 	x=8:y=400


Tweaked pipeline tut 3

Tweaked pipeline tut 3

--- src/Levels/Level.as
+++ src/Levels/Level.as
@@ -250,9 +250,9 @@
 			L_PTutorial2.predecessors.push(L_PTutorial1);

 			L_PTutorial3 = new Level("Pipeline 3", new InstructionSelectGoal, true,
-											   [ConstIn, Adder, Latch, DataWriter, DataReader, InstructionDecoder, InstructionDemux], [OpcodeValue.OP_SAVI, OpcodeValue.OP_ADDM]);
+											   [ConstIn, SlowAdder, Latch, DataWriter, DataReader, InstructionDecoder, InstructionDemux], [OpcodeValue.OP_SAVI, OpcodeValue.OP_ADDM]);
 			(L_PTutorial3.goal as InstructionSelectGoal).allowedTimePerInstr = 40;
-			L_PTutorial1.info = "And this level is " + L_DoubleOp.displayName + " with delay.";
+			L_PTutorial1.info = "And this level is " + L_DoubleOp.displayName + " with delay and a 'slow adder' which works 10x as slowly as the normal one.";
 			L_PTutorial3.predecessors.push(L_PTutorial1);

 			L_PTutorial4 = new Level("Pipeline 4", new PipelineTutorial2Goal, true,


Attempt to add non-smartitems to validation/error tip management

--- as3/smartform/src/com/rpath/raf/util/ValidationHelper.as
+++ as3/smartform/src/com/rpath/raf/util/ValidationHelper.as
@@ -218,6 +218,10 @@
                 {
                     (v as ValidationHelper).errorTipManager = errorTipManager;
                 }
+                else // must just be a plain old item...
+                {
+                    errorTipManager.addComponentListeners(v);
+                }

                 _others[v] = true;
                 setupListeners(v);
@@ -235,6 +239,10 @@
             if (validator)
             {
                 errorTipManager.unregisterValidator(validator);
+            }
+            else
+            {
+                errorTipManager.removeComponentListeners(v);
             }

             // clean up our various partitioned validators


reformat

reformat

--- as/form/includes/removeTextFieldSpaces.as
+++ as/form/includes/removeTextFieldSpaces.as
@@ -1,10 +1,11 @@
-String.prototype.removeTextFieldSpaces = function() {
-	var t = this;
-	while (t.charAt(0) == " ") {
-		t = t.substring(1, t.length);
-	}
-	while (t.charAt(t.length-1) == " ") {
-		t = t.substring(0, t.length-1);
-	}
-	return t;
+String.prototype.removeTextFieldSpaces = function():Void
+{
+		var t = this;
+		while (t.charAt(0) == " ") {
+			t = t.substring(1, t.length);
+		}
+		while (t.charAt(t.length-1) == " ") {
+			t = t.substring(0, t.length-1);
+		}
+		return t;
 };


Updates capitalization in "uploadHandler.php" to match filename. This was exposed on a linux machine which is case sensitive.

--- flexEditor/src/org/arisgames/editor/util/AppConstants.as
+++ flexEditor/src/org/arisgames/editor/util/AppConstants.as
@@ -4,23 +4,23 @@
 {
 	//Server URL
 	//public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://arisgames.org/stagingserver1"; //For other URL's to append to- Staging
-	public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://Phildos.local/server"; //For other URL's to append to- Phil's Machine
+	//public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://Phildos.local/server"; //For other URL's to append to- Phil's Machine
 	//public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://atsosxdev.doit.wisc.edu/aris/server"; //For other URL's to append to- Dev
 	//public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://arisgames.org/qaserver"; //For other URL's to append to- QA
-
+	public static const APPLICATION_ENVIRONMENT_ROOT_URL:String = "http://warhol.arisgames.org/devserver";

 	//Server Version
 	public static const APPLICATION_ENVIRONMENT_SERVER_VERSION:String = "1_5";

 	public static const APPLICATION_ENVIRONMENT_JSON_SERVICES_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"/json.php/aris_" + APPLICATION_ENVIRONMENT_SERVER_VERSION + ".";
 	public static const APPLICATION_ENVIRONMENT_SERVICES_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"/services/aris_" + APPLICATION_ENVIRONMENT_SERVER_VERSION + "/"; //staging
-	public static const APPLICATION_ENVIRONMENT_UPLOAD_SERVER_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"/services/aris_" + APPLICATION_ENVIRONMENT_SERVER_VERSION + "/uploadhandler.php";
+	public static const APPLICATION_ENVIRONMENT_UPLOAD_SERVER_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"/services/aris_" + APPLICATION_ENVIRONMENT_SERVER_VERSION + "/uploadHandler.php";
 	public static const APPLICATION_ENVIRONMENT_GATEWAY_URL:String = APPLICATION_ENVIRONMENT_ROOT_URL+"/gateway.php"; //services-config.xml

 	//Google API
-	//public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAA-Z69V9McvCh02XYNV5UHBBRloMOfjiI7F4SM41AgXh_4cb6l9xTHRyPNO3mgDcJkTIE742EL8ZoQ_Q"; //arisgames.org
+	public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAA-Z69V9McvCh02XYNV5UHBBRloMOfjiI7F4SM41AgXh_4cb6l9xTHRyPNO3mgDcJkTIE742EL8ZoQ_Q"; //arisgames.org
 	//public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAArdp0t4v0pcA_JogLZhjrjBTf4EykMftsP7dwAfDsLsFl_zB7rBTq5-3Hy0k3tU1tgyomozB1YmIfNg"; //davembp
-	public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAAo0AIYqWK4StlyQiw0FkCnhTFFMM2iSZ1Oq9cs2gegUR1k01AuBShe9g60gh2q1UpWRotcj3RpzpT2A"; //Phil's Machine
+	//public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAAo0AIYqWK4StlyQiw0FkCnhTFFMM2iSZ1Oq9cs2gegUR1k01AuBShe9g60gh2q1UpWRotcj3RpzpT2A"; //Phil's Machine
 	//public static const APPLICATION_ENVIRONMENT_GOOGLEMAP_KEY:String = "ABQIAAAA-Z69V9McvCh02XYNV5UHBBQsvlSBtAWfm4N2P3iTGfWOp-UrmRRTU3pFPQwMJB92SZ3plLjvRpMIIw"; //atsosxdev


Transferred from the Adobe Open Source Subversion Repository

Revision: 14834
Author:   klin@adobe.com
Date:     2010-03-17T23:43:45.245400Z

Log Message:
-----------
Merge revision 14833 from 4.x to trunk.

Fix for http://bugs.adobe.com/jira/browse/SDK-25881. Using states with layoutDirection was broken. The issue was that in commitProperties of UIComponent, states were trying to set layoutDirection after we've already dealt with layoutDirection. The state would try to set layoutDirection, but since we are already in commitProperties, the eventual invalidateProperties call in the layoutDirection setter (through styleChanged) doesn't do anything. The fix is to have states resolved before calling invalidateLayoutDirection in commitProperties, so we can pick up on state-specific values of layoutDirection.

QE notes: No
Doc notes: No
Bugs: SDK-25881
Reviewer: Carol, Hans
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="dir" action="M">/flex/sdk/trunk</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -7971,6 +7971,15 @@
             oldScaleY = scaleY;
         }

+        // Typically state changes occur immediately, but during
+        // component initialization we defer until commitProperties to
+        // reduce a bit of the startup noise.
+        if (_currentStateChanged && !initialized)
+        {
+            _currentStateChanged = false;
+            commitCurrentState();
+        }
+
         if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_4_0)
         {
             // If this component's layout direction has changed, or its parent's layoutDirection
@@ -7980,15 +7989,6 @@
             if ((oldLayoutDirection != layoutDirection) || parentChangedFlag ||
                 (parentUIC && (parentUIC.layoutDirection != parentUIC.oldLayoutDirection)))
                 invalidateLayoutDirection();
-        }
-
-        // Typically state changes occur immediately, but during
-        // component initialization we defer until commitProperties to
-        // reduce a bit of the startup noise.
-        if (_currentStateChanged && !initialized)
-        {
-            _currentStateChanged = false;
-            commitCurrentState();
         }

         if (x != oldX || y != oldY)


Transferred from the Adobe Open Source Subversion Repository

Revision: 12817
Author:   jszeto@adobe.com
Date:     2009-12-11T00:19:53.153979Z

Log Message:
-----------
TextField measurement bug fix

SDK-24560 - Scaling errors in UIFTETextField and UITextField

Fixed the measuredHeight and measuredWidth getters in UIFTETextField and UITextField

QE notes: None
Doc notes: None
Bugs: SDK-24560
Reviewer: Chet
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UITextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/.actionScriptProperties</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/mx/core/UIFTETextField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airspark/.flexLibProperties</path>

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

--- frameworks/projects/framework/src/mx/core/UITextField.as
+++ frameworks/projects/framework/src/mx/core/UITextField.as
@@ -1220,7 +1220,7 @@
         if (!stage)
             return textHeight + TEXT_HEIGHT_PADDING;

-        return textHeight * transform.concatenatedMatrix.a + TEXT_HEIGHT_PADDING;
+        return textHeight * transform.concatenatedMatrix.d + TEXT_HEIGHT_PADDING;
     }

     //----------------------------------
@@ -1290,7 +1290,7 @@
         if (!stage)
             return textWidth + TEXT_WIDTH_PADDING;

-        return textWidth * transform.concatenatedMatrix.d + TEXT_WIDTH_PADDING;
+        return textWidth * transform.concatenatedMatrix.a + TEXT_WIDTH_PADDING;
     }

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 7719
Author:   clucier@adobe.com
Date:     2009-06-10T16:54:20.473506Z

Log Message:
-----------
Small tweak to earlier patch.

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

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

--- frameworks/projects/framework/src/mx/utils/ObjectUtil.as
+++ frameworks/projects/framework/src/mx/utils/ObjectUtil.as
@@ -164,7 +164,7 @@
         for each (var p:* in classInfo.properties)
         {
             v = value[p];
-            if (v.hasOwnProperty("uid"))
+            if (v && v.hasOwnProperty("uid"))
                 cloneInternal(result[p], v);
         }
     }


fix typo

fix typo

--- src/aerys/minko/scene/controller/EnterFrameController.as
+++ src/aerys/minko/scene/controller/EnterFrameController.as
@@ -11,8 +11,6 @@
 	/**
 	 * EnterFrameController are controllers triggered whenever the Scene.enterFrame
 	 * signal is executed.
-	 *
-	 * The best way to
 	 *
 	 * @author Jean-Marc Le Roux
 	 *


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

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

 package spark.skins.mobile
 {


Added useful setClipboard function

Added useful setClipboard function

JS clipboard code found here:
http://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript

Working for:
IE10+ (maybe less).
Google Chrome 43+ (~April 2015)
Mozilla Firefox 41+ (shipping ~September 2015)
Opera 29+ (based on Chromium 42, ~April 2015)

--- src/flash/system/System.as
+++ src/flash/system/System.as
@@ -14,9 +14,30 @@

 		//public static function get ime() : IME;

-		public static function setClipboard(param1:String):void
+		public static function setClipboard(text:String):void
 		{
-
+                    var textArea:Object = document.createElement("textarea");
+                    textArea.style.position = 'fixed';
+                    textArea.style.top = 0;
+                    textArea.style.left = 0;
+                    textArea.style.width = '2em';
+                    textArea.style.height = '2em';
+                    textArea.style.padding = 0;
+                    textArea.style.border = 'none';
+                    textArea.style.outline = 'none';
+                    textArea.style.boxShadow = 'none';
+                    textArea.style.background = 'transparent';
+                    textArea.value = text;
+                    document.body.appendChild(textArea as HTMLElement);
+                    textArea.select();
+                    try {
+                        var successful:Boolean = document.execCommand('copy');
+                        var msg:String = successful ? 'successful' : 'unsuccessful';
+                        console.log('Copying text command was ' + msg);
+                    } catch (err) {
+                        console.log('Oops, unable to copy');
+                    }
+                    document.body.removeChild(textArea as HTMLElement);
 		}

 		public static function get totalMemory():uint


as "অসমীয়া" translation #14513. Author: milwac. Incorrect translation submitted before, corrected it

--- conf/messages.as
+++ conf/messages.as
@@ -1,4 +1,4 @@
-playWithAFriend=Bondhur Sathe Khelo
+playWithAFriend=বন্ধু'ৰ বিপক্ষে খেলক
 playWithTheMachine=কম্পিউটাৰ'ৰ বিপক্ষে খেলক
 toInviteSomeoneToPlayGiveThisUrl=অান এজনৰ বিপক্ষে খেলিবলৈ এই URLতু ব্যৱহাৰ কৰক
 gameOver=Khel Sesh


Fixed asdoc formatting bug

Fixed asdoc formatting bug

--- src/org/swiftsuspenders/InjectionMapping.as
+++ src/org/swiftsuspenders/InjectionMapping.as
@@ -49,7 +49,7 @@
 		 * Makes the mapping return a lazily constructed singleton instance of the mapped type for
 		 * each consecutive request.
 		 *
-		 *
Syntactic sugar method wholly equivalent to using toSingleton(type).

+		 *
Syntactic sugar method wholly equivalent to using toSingleton(type).

 		 *
 		 * @return The InjectionMapping the method is invoked on
 		 *