Removed buttons, made a UI-free utility for capturing camera images.

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

--- src/as/com/threerings/flash/CameraSnapshotter.as
+++ src/as/com/threerings/flash/CameraSnapshotter.as
@@ -7,89 +7,125 @@
 import flash.display.BitmapData;
 import flash.display.Sprite;

-import flash.events.Event;
-import flash.events.MouseEvent;
-
 import flash.media.Camera;
 import flash.media.Video;
-
-import flash.utils.ByteArray;
-
-import com.threerings.util.ValueEvent;

 // TODO: use PreferredCamera?
 public class CameraSnapshotter extends Sprite
 {
-    public function CameraSnapshotter (width :int, height :int)
-    {
-        _video = new Video(width, height);
-        _video.attachCamera(Camera.getCamera());
-        _videoInterface.addChild(_video);
-
-        var btn :SimpleTextButton;
-        btn = new SimpleTextButton("snapshot");
-        btn.addEventListener(MouseEvent.CLICK, handleTakeSnapshot);
-        btn.y = height;
-        _videoInterface.addChild(btn);
-
-        btn = new SimpleTextButton("cancel");
-        btn.addEventListener(MouseEvent.CLICK, handleCancel);
-        btn.x = width - btn.width;
-        btn.y = height;
-        _videoInterface.addChild(btn);
-
-        _bmp = new BitmapData(width, height, false);
-        _previewInterface.addChild(new Bitmap(_bmp));
-
-        btn = new SimpleTextButton("accept");
-        btn.addEventListener(MouseEvent.CLICK, handleAccept);
-        btn.y = height;
-        _previewInterface.addChild(btn);
-
-        btn = new SimpleTextButton("clear");
-        btn.addEventListener(MouseEvent.CLICK, handleClear);
-        btn.x = width - btn.width;
-        btn.y = height;
-        _previewInterface.addChild(btn);
-
-        addChild(_videoInterface);
-    }
-
+    /**
+     * Static method to determine if the user even has a camera.
+     */
     public static function hasCamera () :Boolean
     {
         var names :Array = Camera.names;
         return (names != null && names.length > 0);
     }

-    protected function handleTakeSnapshot (event :MouseEvent) :void
+    /**
+     * @see setCamera
+     */
+    public function CameraSnapshotter (cameraName :String = null)
     {
-        _bmp.draw(_video);
-        removeChild(_videoInterface);
-        addChild(_previewInterface);
+        setCameraName(cameraName);
     }

-    protected function handleClear (event :MouseEvent) :void
+    override public function get width () :Number
     {
-        removeChild(_previewInterface);
-        addChild(_videoInterface);
+        return (_camera == null) ? 0 : _camera.width;
     }

-    protected function handleCancel (event :MouseEvent) :void
+    override public function get height () :Number
     {
-        dispatchEvent(new ValueEvent(Event.COMPLETE, null));
+        return (_camera == null) ? 0 : _camera.height;
     }

-    protected function handleAccept (event :MouseEvent) :void
+    /**
+     * @param cameraName the actual name of the camera, not the index (as used to get it from
+     * the Camera class).
+     */
+    public function setCameraName (cameraName :String = null) :void
     {
-        dispatchEvent(new ValueEvent(Event.COMPLETE, _bmp));
+        // translate the real name of the camera into the "name" used to get it.
+        var nameIdx :String = null;
+        if (cameraName != null) {
+            var names :Array = Camera.names;
+            for (var ii :int = 0; ii < names.length; ii++) {
+                if (cameraName === names[ii]) {
+                    nameIdx = String(ii);
+                    break;
+                }
+            }
+        }
+
+        setCamera(Camera.getCamera(nameIdx));
     }
+
+    public function setCamera (camera :Camera) :void
+    {
+        if (_video != null) {
+            if (_bitmap.parent != null) {
+                removeChild(_bitmap);
+            }
+            if (_video.parent != null) {
+                removeChild(_video);
+            }
+            _bitmap = null;
+            _video = null;
+        }
+
+        _camera = camera;
+        if (_camera == null) {
+            return;
+        }
+
+        _video = new Video(_camera.width, _camera.height);
+        _bitmap = new Bitmap(new BitmapData(_camera.width, _camera.height, false));
+        _video.attachCamera(_camera);
+        addChild(_video);
+    }
+
+    public function getCameraName () :String
+    {
+        return (_camera == null) ? null : _camera.name;
+    }
+
+    public function takeSnapshot () :void
+    {
+        if (_camera == null) {
+            return; // throw exception?
+        }
+
+        _bitmap.bitmapData.draw(_video);
+        if (_video.parent != null) {
+            removeChild(_video);
+            addChild(_bitmap);
+        }
+    }
+
+    public function clearSnapshot () :void
+    {
+        if (_camera == null) {
+            return;
+        }
+        if (_video.parent == null) {
+            removeChild(_bitmap);
+            addChild(_video);
+        }
+    }
+
+    public function getSnapshot () :BitmapData
+    {
+        if (_camera == null) {
+            return null;
+        }
+        return _bitmap.bitmapData;
+    }
+
+    protected var _camera :Camera;

     protected var _video :Video;

-    protected var _bmp :BitmapData;
-
-    protected var _videoInterface :Sprite = new Sprite();
-
-    protected var _previewInterface :Sprite = new Sprite();
+    protected var _bitmap :Bitmap;
 }
 }


Expose utility method to determine numeric fields.

--- src/com/esri/builder/supportClasses/FieldUtil.as
+++ src/com/esri/builder/supportClasses/FieldUtil.as
@@ -59,15 +59,9 @@
     {
         var numericFields:Array = [];

-        var isFieldNumeric:Boolean;
         for each (var field:Field in fields)
         {
-            isFieldNumeric = field.type == Field.TYPE_DOUBLE
-                || field.type == Field.TYPE_INTEGER
-                || field.type == Field.TYPE_SINGLE
-                || field.type == Field.TYPE_SMALL_INTEGER;
-
-            if (isFieldNumeric)
+            if (isFieldNumeric(field))
             {
                 numericFields.push(field);
             }
@@ -75,5 +69,13 @@

         return numericFields;
     }
+
+    public static function isFieldNumeric(field:Field):Boolean
+    {
+        return field.type == Field.TYPE_DOUBLE
+            || field.type == Field.TYPE_INTEGER
+            || field.type == Field.TYPE_SINGLE
+            || field.type == Field.TYPE_SMALL_INTEGER;
+    }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 18987
Author:   rfrishbe@adobe.com
Date:     2010-12-03T01:08:34.503999Z

Log Message:
-----------
PARB changes for sizeElement/positionElement.  MobileSkin and MobileItemRenderer's methods have been renamed: resizeElement() -> setElementSize(), positionElement() -> setElementPosition().

Also, cleaning up text reflow for TextAreaSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/MobileSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ActionBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/VScrollBarSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileIconItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ButtonSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderTrackSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ActionBarButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/SelectableButtonSkinBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderThumbSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/HScrollBarSkin.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/HSliderSkin.as
@@ -213,9 +213,9 @@
         var calculatedTrackY:int = Math.max(Math.round((unscaledHeight - track.getPreferredBoundsHeight())/2), 0);

         // size and position
-        resizeElement(thumb, thumb.getPreferredBoundsWidth(), thumb.getPreferredBoundsHeight()); // thumb does NOT scale
-        resizeElement(track, calculatedSkinWidth, track.getPreferredBoundsHeight()); // note track is NOT scaled vertically
-        positionElement(track, 0, calculatedTrackY);
+        setElementSize(thumb, thumb.getPreferredBoundsWidth(), thumb.getPreferredBoundsHeight()); // thumb does NOT scale
+        setElementSize(track, calculatedSkinWidth, track.getPreferredBoundsHeight()); // note track is NOT scaled vertically
+        setElementPosition(track, 0, calculatedTrackY);
     }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

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

--- frameworks/projects/spark/src/spark/events/LoaderInvalidationEvent.as
+++ frameworks/projects/spark/src/spark/events/LoaderInvalidationEvent.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.events
 {


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

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

 package mx.controls.advancedDataGridClasses
 {


XIFF-38: Made XMPPConnection throw event from getRegistrationFields_result

--- src/org/jivesoftware/xiff/core/XMPPConnection.as
+++ src/org/jivesoftware/xiff/core/XMPPConnection.as
@@ -477,6 +477,8 @@
 				var event:RegistrationFieldsEvent = new RegistrationFieldsEvent();
 				event.fields = fields;
 				event.data = ext;
+
+				dispatchEvent(event);
 			}
 			catch (e:Error)
 			 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 20017
Author:   jasonsj@adobe.com
Date:     2011-01-31T20:17:11.728603Z

Log Message:
-----------
Fixed StyleableTextField clipping when height is less than tightTextHeight. Fixed ButtonSkinBase vertical label clipping to allow text to appear in the bottom padding when using horizontal icon placement.

QE notes: None
Doc notes:
Bugs:
SDK-29275 Button label displayed outside button when height is less than the label
Reviewer: mcho
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/ButtonSkinBase.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/StyleableTextField.as
@@ -382,12 +382,32 @@
     //----------------------------------
     //  Text alignment helpers
     //----------------------------------
+
     /**
      *  @private
      *  The height of the first line of text to the baseline of the bottom line
      *  of text.  Handles both single line and multiline text.
      */
+    private function get tightTextTopOffset():Number
+    {
+        updateTightTextSizes();
+
+        return _tightTextTopOffset;
+    }
+
+    /**
+     *  @private
+     *  The height of the first line of text to the baseline of the bottom line
+     *  of text.  Handles both single line and multiline text.
+     */
     private function get tightTextHeight() :Number
+    {
+        updateTightTextSizes();
+
+        return _tightTextHeight;
+    }
+
+    private function updateTightTextSizes():void
     {
         commitStyles();

@@ -408,16 +428,14 @@
             if (numLines == 1) // account for the extra leading on single line text
                 bottomOffset += metrics.leading;

-            var topOffset:Number = getTextTopOffset(defaultTextFormat);
-            _tightTextHeight = measuredTextSize.y - topOffset - bottomOffset;
+            _tightTextTopOffset = getTextTopOffset(defaultTextFormat);
+            _tightTextHeight = measuredTextSize.y - _tightTextTopOffset - bottomOffset;

             if (isEmpty)
                 text = "";

             invalidateTightTextHeight = false;
         }
-
-        return _tightTextHeight;
     }

     /**
@@ -1382,7 +1400,7 @@
         {
             // return the y position of the text within the text field.  we calculate this value
             // using text field's y, offset by the text top offset
-            return y + getTextTopOffset(defaultTextFormat);
+            return y + tightTextTopOffset;
         }
         else
         {
@@ -1483,21 +1501,13 @@
     /**
      * @private
      */
-    public function setEstimatedSize(estimatedWidth:Number=NaN, estimatedHeight:Number=NaN, invalidateSize:Boolean=true):void
-    {
-        // TODO (jasonsj)
-    }
-
-    /**
-     * @private
-     */
     public function setLayoutBoundsPosition(x:Number, y:Number, postLayoutTransform:Boolean=true):void
     {
         if (useTightTextBounds)
         {
             // offset the positions by the left gutters and the top offset
             this.x = x - StyleableTextField.TEXT_WIDTH_PADDING/2;
-            this.y = y - getTextTopOffset(defaultTextFormat);
+            this.y = y - tightTextTopOffset;
         }
         else
         {
@@ -1527,10 +1537,23 @@
         if (isNaN(newHeight))
             newHeight = getPreferredBoundsHeight();

-        // re-add the top and bottom offsets.  (measuredTextSize.y - tightTextHeight) gives us
-        // the sum of top and bottom offsets
-        if (useTightTextBounds && (measuredTextSize.y > tightTextHeight))
-            newHeight += (measuredTextSize.y - tightTextHeight);
+        if (useTightTextBounds)
+        {
+            if (newHeight > 0)
+            {
+                var bottomOffset:Number = measuredTextSize.y - tightTextTopOffset - tightTextHeight;
+
+                // when clipping, allow gutter to be outside of height
+                // use 2x gutter (actual gutter is not part of tight text height)
+                // when newHeight==1, actual visible height==3 (1px + 1x gutter)
+                if (newHeight < tightTextHeight)
+                    bottomOffset = StyleableTextField.TEXT_HEIGHT_PADDING;
+
+                // re-add the top and bottom offsets.  (measuredTextSize.y - tightTextHeight) gives us
+                // the sum of top and bottom offsets
+                newHeight += (tightTextTopOffset + bottomOffset);
+            }
+        }

         this.height = newHeight;
     }
@@ -1657,30 +1680,6 @@
     }

     //----------------------------------
-    //  estimatedHeight
-    //----------------------------------
-
-    /**
-     * @private
-     */
-    public function get estimatedHeight():Number
-    {
-        return NaN;
-    }
-
-    //----------------------------------
-    //  estimatedWidth
-    //----------------------------------
-
-    /**
-     * @private
-     */
-    public function get estimatedWidth():Number
-    {
-        return NaN;
-    }
-
-    //----------------------------------
     //  hasLayoutMatrix3D
     //----------------------------------

@@ -2024,6 +2023,11 @@

     /**
      *  @private
+     */
+    private var _tightTextTopOffset:Number;
+
+    /**
+     *  @private
      *  Used to keep track if this StyleableTextField is already in "scrolling mode"
      *  and what scroller it is using to scroll.  This is so we can respond appropriately
      *  to other touchInteractionStarting and touchInteractionEnd events.


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Added halfWidth & halfHeight properties. Added setCamera(), anchorTo(), rotateAround(), and clampInRect() functions.

--- net/flashpunk/FP.as
+++ net/flashpunk/FP.as
@@ -81,6 +81,16 @@
 		public static var camera:Point = new Point;

 		/**
+		 * Half the screen width.
+		 */
+		public static function get halfWidth():Number { return width / 2; }
+
+		/**
+		 * Half the screen height.
+		 */
+		public static function get halfHeight():Number { return height / 2; }
+
+		/**
 		 * The currently active World object. When you set this, the World is flagged
 		 * to switch, but won't actually do so until the end of the current frame.
 		 */
@@ -89,6 +99,17 @@
 		{
 			if (_world == value) return;
 			_goto = value;
+		}
+
+		/**
+		 * Sets the camera position.
+		 * @param	x	X position.
+		 * @param	y	Y position.
+		 */
+		public static function setCamera(x:Number = 0, y:Number = 0):void
+		{
+			camera.x = x;
+			camera.y = y;
 		}

 		/**
@@ -218,6 +239,21 @@
 		}

 		/**
+		 * Anchors the object to a position.
+		 * @param	object		The object to anchor.
+		 * @param	anchor		The anchor object.
+		 * @param	distance	The max distance object can be anchored to the anchor.
+		 */
+		public static function anchorTo(object:Object, anchor:Object, distance:Number = 0):void
+		{
+			point.x = object.x - anchor.x;
+			point.y = object.y - anchor.y;
+			if (point.length > distance) point.normalize(distance);
+			object.x = anchor.x + point.x;
+			object.y = anchor.y + point.y;
+		}
+
+		/**
 		 * Finds the angle (in degrees) from point 1 to point 2.
 		 * @param	x1		The first x-position.
 		 * @param	y1		The first y-position.
@@ -236,12 +272,26 @@
 		 * @param	object		The object whose x/y properties should be set.
 		 * @param	angle		The angle of the vector, in degrees.
 		 * @param	length		The distance to the vector from (0, 0).
-		 */
-		public static function angleXY(object:Object, angle:Number, length:Number = 1):void
+		 * @param	x			X offset.
+		 * @param	y			Y offset.
+		 */
+		public static function angleXY(object:Object, angle:Number, length:Number = 1, x:Number = 0, y:Number = 0):void
 		{
 			angle *= RAD;
-			object.x = Math.cos(angle) * length;
-			object.y = Math.sin(angle) * length;
+			object.x = Math.cos(angle) * length + x;
+			object.y = Math.sin(angle) * length + y;
+		}
+
+		/**
+		 * Rotates the object around the anchor by the specified amount.
+		 * @param	object		Object to rotate around the anchor.
+		 * @param	anchor		Anchor to rotate around.
+		 * @param	angle		The amount of degrees to rotate by.
+		 */
+		public static function rotateAround(object:Object, anchor:Object, angle:Number = 0, relative:Boolean = true):void
+		{
+			if (relative) angle += FP.angle(anchor.x, anchor.y, object.x, object.y);
+			FP.angleXY(object, angle, FP.distance(anchor.x, anchor.y, object.x, object.y), anchor.x, anchor.y);
 		}

 		/**
@@ -339,6 +389,20 @@
 			}
 			value = value < min ? value : min;
 			return value > max ? value : max;
+		}
+
+		/**
+		 * Clamps the object inside the rectangle.
+		 * @param	object		The object to clamp (must have an x and y property).
+		 * @param	x			Rectangle's x.
+		 * @param	y			Rectangle's y.
+		 * @param	width		Rectangle's width.
+		 * @param	height		Rectangle's height.
+		 */
+		public static function clampInRect(object:Object, x:Number, y:Number, width:Number, height:Number, padding:Number):void
+		{
+			object.x = clamp(object.x, x + padding, x + width - padding);
+			object.y = clamp(object.y, y + padding, y + height - padding);
 		}

 		/**


A bit of cleanup

A bit of cleanup

--- unittests/TestDisjunctiveSyllogism.as
+++ unittests/TestDisjunctiveSyllogism.as
@@ -3,25 +3,14 @@
 	public class TestDisjunctiveSyllogism
 	{
 		import logic.DisjunctiveSyllogism;
+		import org.flexunit.Assert;

-
-
-		import org.flexunit.Assert;
 		private var djs:DisjunctiveSyllogism;
 		private var djsReverse:DisjunctiveSyllogism;

 		[Before]
 		public function setUp():void
 		{
-			/*
-			* reversePos apparently differentiates between Basic Claim and Reason 1.
-			* ~~ Printing all reasons in NotPFalse
-			* It is not the case that Reason 1
-			* Reason 2
-			* ~~ Printing all reasons in Reverse NotPFalse
-			* It is not the case that Basic Claim
-			* Reason 2
-			*/
 			//DisjunctiveSyllogism(claimText:String, reasonText:Array, reversePos:Boolean,inferenceText:String="", inferencePresent:Boolean=false)
 			djsReverse = new DisjunctiveSyllogism("Basic Claim", ["Reason 1", "Reason 2"], true, "Either Foo or Bar, and Baz unless Quux", false);
 			djs = new DisjunctiveSyllogism("Basic Claim", ["Reason 1", "Reason 2"], false, "Either Foo or Bar, and Baz unless Quux", false);


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

--- frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as
+++ frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as
@@ -0,0 +1,847 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core.windowClasses
+{
+
+import flash.display.DisplayObject;
+import flash.display.NativeWindowDisplayState;
+import flash.events.Event;
+import flash.events.MouseEvent;
+import flash.events.NativeWindowDisplayStateEvent;
+import flash.geom.Rectangle;
+import flash.system.Capabilities;
+import flash.text.TextFormat;
+import flash.text.TextFormatAlign;
+import mx.controls.Button;
+import mx.core.WindowedApplication;
+import mx.core.IFlexDisplayObject;
+import mx.core.IWindow;
+import mx.core.mx_internal;
+import mx.core.UIComponent;
+import mx.core.UITextField;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager;
+
+use namespace mx_internal;
+
+/**
+ *  The default title bar for a WindowedApplication or a Window.
+ */
+public class TitleBar extends UIComponent
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private static function isMac():Boolean
+    {
+    	return Capabilities.os.substring(0, 3) == "Mac";
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 */
+	public function TitleBar():void
+	{
+		super();
+
+        doubleClickEnabled = true;
+
+		addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+		addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  A reference to this Application's title bar skin.
+     *  This is a child of the titleBar.
+     */
+    mx_internal var titleBarBackground:IFlexDisplayObject;
+
+	/**
+     *  @private
+     *  This is the actual object created from the _titleIcon class
+     */
+    mx_internal var titleIconObject:Object;
+
+    /**
+     *  @private
+     */
+    private var minimizeButtonSkin:Class;
+
+	/**
+     *  @private
+     */
+	private var maximizeButtonSkin:Class;
+
+    /**
+     *  @private
+     */
+	private var restoreButtonSkin:Class;
+
+	/**
+     *  @private
+     */
+  	private var closeButtonSkin:Class;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+	//----------------------------------
+    //  closeButton
+    //----------------------------------
+
+    /**
+     *  The Button object that defines the close button.
+     */
+    public var closeButton:Button;
+
+    //----------------------------------
+    //  maximizeButton
+    //----------------------------------
+
+    /**
+     *  The Button object that defines the maximize button.
+     */
+    public var maximizeButton:Button;
+
+    //----------------------------------
+    //  minimizeButton
+    //----------------------------------
+
+    /**
+     *  The Button object that defines the minimize button.
+     */
+    public var minimizeButton:Button;
+
+	//----------------------------------
+    //  title
+    //----------------------------------
+
+    /**
+     *  Storage for the title property.
+     */
+    private var _title:String = "";
+
+    /**
+     *  @private
+     */
+    private var titleChanged:Boolean = false;
+
+    /**
+     *  The title that appears in the window title bar and
+     *  the dock/taskbar.
+     *
+     *  @default ""
+     */
+    public function get title():String
+    {
+        return _title;
+    }
+
+    /**
+     *  @private
+     */
+    public function set title(value:String):void
+    {
+        _title = value;
+        titleChanged = true;
+
+        invalidateProperties();
+        invalidateSize();
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  titleIcon
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the titleIcon property.
+     */
+    private var _titleIcon:Class;
+
+    /**
+     *  @private
+     */
+    private var titleIconChanged:Boolean = false;
+
+    /**
+     *  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();
+    }
+
+    //----------------------------------
+    //  titleTextField
+    //----------------------------------
+
+    /**
+     *  The UITextField in the title bar that displays the application title.
+     */
+    public var titleTextField:UITextField;
+
+    //----------------------------------
+    //  window
+    //----------------------------------
+
+	/**
+	 *  The IWindow that owns this TitleBar.
+	 */
+	private function get window():IWindow
+	{
+		return IWindow(parent);
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+	 	super.createChildren();
+
+		var titleBarBackgroundClass:Class =
+        	getStyle("titleBarBackgroundSkin");
+        if (titleBarBackgroundClass)
+        {
+            if (!titleBarBackground)
+            {
+	            titleBarBackground = new titleBarBackgroundClass();
+	            var titleBackgroundUIComponent:IStyleClient =
+	                titleBarBackground as IStyleClient;
+	            if (titleBackgroundUIComponent)
+	            {
+	                titleBackgroundUIComponent.setStyle(
+						"backgroundImage", undefined);
+	            }
+	            var titleBackgroundStyleable:ISimpleStyleClient =
+	                titleBarBackground as ISimpleStyleClient;
+	            if (titleBackgroundStyleable)
+	                titleBackgroundStyleable.styleName = this;
+	            addChild(DisplayObject(titleBarBackground));
+	        }
+        }
+
+        if (!titleTextField)
+        {
+            titleTextField = UITextField(createInFontContext(UITextField));
+            titleTextField.text = _title;
+            titleTextField.styleName = getStyle("titleTextStyleName");
+            titleTextField.enabled = true;
+            addChild(titleTextField);
+        }
+
+        if (!titleIconObject && _titleIcon)
+        {
+            titleIconObject = new _titleIcon();
+            addChild(DisplayObject(titleIconObject));
+        }
+
+        if (!minimizeButton)
+        {
+            minimizeButton = new Button();
+            minimizeButtonSkin = getStyle("minimizeButtonSkin");
+            if (minimizeButtonSkin)
+            	 minimizeButton.setStyle("skin", minimizeButtonSkin);
+            minimizeButton.focusEnabled = false;
+            minimizeButton.enabled = window.minimizable;
+			minimizeButton.addEventListener(MouseEvent.MOUSE_DOWN,
+											button_mouseDownHandler);
+			minimizeButton.addEventListener(MouseEvent.CLICK,
+											minimizeButton_clickHandler);
+            addChild(minimizeButton);
+        }
+
+        if (!maximizeButton)
+        {
+            maximizeButton = new Button();
+            maximizeButtonSkin = getStyle("maximizeButtonSkin");
+            if (maximizeButtonSkin)
+                maximizeButton.setStyle("skin", maximizeButtonSkin);
+            maximizeButton.focusEnabled = false;
+            maximizeButton.enabled = window.maximizable;
+			maximizeButton.addEventListener(MouseEvent.MOUSE_DOWN,
+											button_mouseDownHandler);
+			maximizeButton.addEventListener(MouseEvent.CLICK,
+											maximizeButton_clickHandler);
+            addChild(maximizeButton);
+
+            restoreButtonSkin = isMac() ? null : getStyle("restoreButtonSkin");
+        }
+
+        if (!closeButton)
+        {
+            closeButton = new Button();
+            closeButtonSkin = getStyle("closeButtonSkin");
+            if (closeButtonSkin)
+           		closeButton.setStyle("skin", closeButtonSkin);
+            closeButton.focusEnabled = false;
+			closeButton.addEventListener(MouseEvent.MOUSE_DOWN,
+										 button_mouseDownHandler);
+			closeButton.addEventListener(MouseEvent.CLICK,
+										 closeButton_clickHandler);
+            addChild(closeButton);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+		super.commitProperties();
+
+    	if (titleChanged)
+    	{
+    		titleTextField.text = _title;
+    		titleChanged = false;
+    	}
+
+    	if (titleIconChanged)
+    	{
+    		if (titleIconObject)
+            {
+                removeChild(DisplayObject(titleIconObject));
+                titleIconObject = null;
+            }
+            if (_titleIcon)
+            {
+                titleIconObject = new _titleIcon();
+                addChild(DisplayObject(titleIconObject));
+            }
+            titleIconChanged = false;
+    	}
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+    	super.measure();
+
+		titleTextField.validateNow();
+		if (titleTextField.textHeight == 0)
+		{
+			titleTextField.text = " ";
+			titleTextField.validateNow();
+		}
+
+		measuredHeight = Math.max((titleTextField.textHeight +
+						 UITextField.TEXT_HEIGHT_PADDING),
+						 Math.max(maximizeButton.measuredHeight,
+						 minimizeButton.measuredHeight,
+						 closeButton.measuredHeight) + 12);
+		measuredWidth = titleTextField.width +
+						maximizeButton.measuredWidth +
+						minimizeButton.measuredWidth +
+						closeButton.measuredWidth;
+
+		if (titleIconObject)
+	 	{
+	 		measuredHeight = Math.max(measuredHeight,
+									  titleIconObject.height + 1);
+	 		measuredWidth += titleIconObject.width;
+	 	}
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+												  unscaledHeight:Number):void
+    {
+    	super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+    	// If window is closed, we need to exit.
+        if (window.nativeWindow.closed)
+        	return;
+
+        var leftOffset:Number = 0;
+        var rightOffset:Number = 5;
+
+		// Account for rounded corners.
+        var cornerOffset:int = getStyle("cornerRadius") / 2;
+
+		// Position the titleBarBackground within the titleBar.
+        if (titleBarBackground)
+        {
+            titleBarBackground.move(0, 0);
+            IFlexDisplayObject(titleBarBackground).setActualSize(
+				unscaledWidth, unscaledHeight);
+        }
+
+        // Position the titleIconObject
+        if (titleIconObject)
+        {
+            var h:int = titleIconObject.height;
+            var offset:int = (height - h) / 2;
+            titleIconObject.move(cornerOffset, offset);
+            leftOffset += cornerOffset + titleIconObject.width +
+						  getStyle("buttonPadding");
+        }
+
+		// If we're on Windows, check to see if we're maximized or not.
+		if (!isMac())
+		{
+			if (window.nativeWindow.displayState ==
+				NativeWindowDisplayState.MAXIMIZED)
+			{
+				if (restoreButtonSkin)
+					maximizeButton.setStyle("skin", restoreButtonSkin);
+			}
+			else
+			{
+				maximizeButton.setStyle("skin", maximizeButtonSkin);
+			}
+		}
+
+        var buttonAlign:String = getStyle("buttonAlignment");
+        if (buttonAlign == "right")
+        {
+            placeButtons(buttonAlign, width, height,
+                         leftOffset, rightOffset, cornerOffset);
+       	}
+        else if (buttonAlign == "left")
+        {
+            placeButtons(buttonAlign,width,
+                         height, leftOffset, rightOffset, cornerOffset);
+        }
+        else
+        {
+            if (isMac())
+            {
+                buttonAlign = "left";
+                placeButtons("left", width, height,
+                             leftOffset, rightOffset, cornerOffset);
+            }
+            else
+            {
+                placeButtons("right", width, height,
+                             leftOffset, rightOffset, cornerOffset);
+            }
+        }
+
+        var titleAlign:String =
+			String(getStyle("titleAlignment"));
+        if (titleAlign == "center" || titleAlign == "left")
+ 			placeTitle(titleAlign, leftOffset, rightOffset, buttonAlign);
+        else if (isMac())
+            placeTitle("center",  leftOffset, rightOffset, buttonAlign);
+        else
+            placeTitle("left",  leftOffset, rightOffset, buttonAlign);
+    }
+
+    /**
+     *  Called by the StyleManager when a style changes.
+     *
+     *  @param styleProp the name of the style that's changed.
+	 *  In some cases, it can be null, usually when changing
+	 *  the global style or styleName.
+     */
+    override public function styleChanged(styleProp:String):void
+    {
+        super.styleChanged(styleProp);
+
+		invalidateDisplayList();
+
+        var allStyles:Boolean = !styleProp || styleProp == "styleName";
+
+		if (allStyles || styleProp == "titleBarBackgroundSkin")
+		{
+			var titleBarBackgroundClass:Class =
+        		getStyle("titleBarBackgroundSkin");
+
+			if (titleBarBackgroundClass)
+	        {
+	            // Remove existing background
+                if (titleBarBackground)
+                {
+                    removeChild(DisplayObject(titleBarBackground));
+                    titleBarBackground = null;
+                }
+	            titleBarBackground = new titleBarBackgroundClass();
+	            var titleBackgroundUIComponent:IStyleClient =
+	                titleBarBackground as IStyleClient;
+	            if (titleBackgroundUIComponent)
+	            {
+	                titleBackgroundUIComponent.setStyle(
+	                	"backgroundImage", undefined);
+	            }
+	            var titleBackgroundStyleable:ISimpleStyleClient =
+	                titleBarBackground as ISimpleStyleClient;
+	            if (titleBackgroundStyleable)
+	                titleBackgroundStyleable.styleName = this;
+	            addChildAt(DisplayObject(titleBarBackground), 0);
+	        }
+		}
+
+		if (allStyles || styleProp == "titleTextStyleName")
+		{
+			if (titleTextField)
+				titleTextField.styleName = getStyle("titleTextStyleName");
+		}
+
+		if (allStyles || styleProp == "closeButtonSkin")
+		{
+			closeButtonSkin = getStyle("closeButtonSkin");
+            if (closeButtonSkin && closeButton)
+           		closeButton.setStyle("skin", closeButtonSkin);
+        }
+
+		if (allStyles || styleProp == "maximizeButtonSkin")
+        {
+         	maximizeButtonSkin = getStyle("maximizeButtonSkin");
+            if (maximizeButtonSkin && maximizeButton)
+                maximizeButton.setStyle("skin", maximizeButtonSkin);
+        }
+
+		if (allStyles || styleProp == "minimizeButtonSkin")
+        {
+         	minimizeButtonSkin = getStyle("minimizeButtonSkin");
+            if (minimizeButtonSkin && minimizeButton)
+            	 minimizeButton.setStyle("skin", minimizeButtonSkin);
+        }
+
+		if (allStyles || styleProp == "restoreButtonSkin")
+        {
+         	restoreButtonSkin = getStyle("restoreButtonSkin");
+		}
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Determines the placement of the buttons in the title bar.
+     *
+     *  @param align button alignment
+	 *
+     *  @param unscaledWidth width of the title bar
+	 *
+     *  @param unscaledHeight height of the title bar
+	 *
+     *  @param leftOffset how much space to allow on left for corners, etc.
+	 *
+     *  @param rightOffset how much space to allow on right for corners, etc.
+	 *
+     *  @param cornerOffset how much to indent things to take into account
+	 *  corner radius
+     */
+    protected function placeButtons(align:String,
+									unscaledWidth:Number, unscaledHeight:Number,
+									leftOffset:Number, rightOffset:Number,
+									cornerOffset:Number):void
+    {
+        var pad:Number = getStyle("buttonPadding");
+        var edgePad:Number = getStyle("titleBarButtonPadding");
+
+		minimizeButton.setActualSize(minimizeButton.measuredWidth,
+									 minimizeButton.measuredHeight);
+        maximizeButton.setActualSize(maximizeButton.measuredWidth,
+									 maximizeButton.measuredHeight);
+        closeButton.setActualSize(closeButton.measuredWidth,
+								  closeButton.measuredHeight);
+
+		if (align == "right")
+        {
+            minimizeButton.move(
+				unscaledWidth - (minimizeButton.measuredWidth +
+            	maximizeButton.measuredWidth + closeButton.measuredWidth +
+				(2 * pad)) - cornerOffset - edgePad,
+				(unscaledHeight - minimizeButton.measuredHeight) / 2);
+
+			maximizeButton.move(
+				unscaledWidth - (maximizeButton.measuredWidth +
+            	closeButton.measuredWidth + pad) - cornerOffset - edgePad,
+				(unscaledHeight - maximizeButton.measuredHeight) / 2);
+
+			closeButton.move(
+				unscaledWidth - closeButton.measuredWidth -
+				cornerOffset - edgePad,
+            	(unscaledHeight - closeButton.measuredHeight) / 2);
+        }
+        else
+        {
+            edgePad = Math.max(edgePad, leftOffset);
+
+			closeButton.move(
+				edgePad,
+            	(unscaledHeight - closeButton.measuredHeight) / 2);
+
+			minimizeButton.move(
+				pad + edgePad + closeButton.measuredWidth,
+            	(unscaledHeight - minimizeButton.measuredHeight) / 2);
+
+			maximizeButton.move(
+				edgePad + (pad * 2) +
+            	closeButton.measuredWidth + minimizeButton.measuredWidth,
+            	(unscaledHeight - maximizeButton.measuredHeight) / 2);
+        }
+    }
+
+    /**
+     *  Determines the alignment of the title in the title bar.
+     *
+     *  @param titleAlign how to align the title.
+	 *
+     *  @param leftOffset how much space to allow on left for corners, etc.
+	 *
+     *  @param rightOffset how much space to allow on right for corners, etc.
+	 *
+     *  @param buttonAlign the way the buttons are aligned
+     */
+    protected function placeTitle(titleAlign:String,
+                                  leftOffset:Number, rightOffset:Number,
+                                  buttonAlign:String):void
+    {
+        titleTextField.text = _title;
+        titleTextField.validateNow();
+
+        var charWidth:Number = titleTextField.getLineMetrics(0).width /
+                        	   titleTextField.length;
+
+        if (titleAlign == "left")
+        {
+            if (buttonAlign == "left")
+            {
+                titleTextField.setActualSize(
+                	width - leftOffset - rightOffset - 2 -
+                    Math.max((closeButton.x + closeButton.measuredWidth),
+                    (minimizeButton.x + minimizeButton.measuredWidth),
+                    (maximizeButton.x + maximizeButton.measuredWidth)),
+                    measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING);
+
+                titleTextField.move(
+					leftOffset +
+					Math.max((closeButton.x + closeButton.measuredWidth),
+                    (minimizeButton.x + minimizeButton.measuredWidth),
+					(maximizeButton.x + maximizeButton.measuredWidth)),
+					(height - (measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING))/2);
+
+                titleTextField.truncateToFit();
+            }
+            else
+            {
+                titleTextField.setActualSize(
+                	Math.max(0, Math.min(
+                	width - leftOffset - rightOffset,
+                	minimizeButton.x )) - 2,
+                    measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING);
+
+				titleTextField.move(
+					leftOffset,
+                 	(height - (measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING))/2);
+
+				titleTextField.truncateToFit();
+            }
+        }
+        else // titleAlign is center
+        {
+            var tf:TextFormat = new TextFormat();
+            tf.align = TextFormatAlign.CENTER;
+            titleTextField.setTextFormat(tf);
+
+			if (buttonAlign == "left")
+            {
+                titleTextField.setActualSize(
+                	width - leftOffset - rightOffset -
+                    Math.max((closeButton.x + closeButton.measuredWidth),
+                    (minimizeButton.x + minimizeButton.measuredWidth),
+                    (maximizeButton.x + maximizeButton.measuredWidth)) - 2,
+                    measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING);
+
+				titleTextField.move(
+                	Math.max((closeButton.x + closeButton.measuredWidth),
+                    (minimizeButton.x + minimizeButton.measuredWidth),
+                    (maximizeButton.x + maximizeButton.measuredWidth)),
+                    (height - (measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING))/2);
+
+				titleTextField.truncateToFit();
+            }
+            else
+            {
+                titleTextField.setActualSize(
+                	width - leftOffset - rightOffset -
+                	(width - Math.min(closeButton.x,
+                	minimizeButton.x, maximizeButton.x)) - 2,
+                    measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING);
+
+				titleTextField.move(
+					leftOffset,
+					(height - (measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING))/2);
+
+				titleTextField.truncateToFit();
+            }
+        }
+    }
+
+    /**
+     *  @private
+     */
+    private function measureChromeText(textField:UITextField):Rectangle
+    {
+        var textWidth:Number = 20;
+        var textHeight:Number = 14;
+
+        if (textField && textField.text)
+        {
+            textField.validateNow();
+            textWidth = textField.textWidth;
+            textHeight = textField.textHeight;
+        }
+
+        return new Rectangle(0, 0, textWidth, textHeight);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handlers
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+     *  @private
+     */
+	private function mouseDownHandler(event:MouseEvent):void
+	{
+		window.nativeWindow.startMove();
+
+		event.stopPropagation();
+	}
+
+	/**
+     *  Handles doubleClick event in a platform-appropriate manner
+     */
+    protected function doubleClickHandler(event:MouseEvent):void
+    {
+		if (isMac())
+		{
+			window.minimize();
+		}
+		else
+		{
+			if (window.nativeWindow.displayState ==
+				NativeWindowDisplayState.MAXIMIZED)
+			{
+	    		window.restore();
+			}
+	    	else
+			{
+	    		window.maximize();
+			}
+		}
+    }
+
+	/**
+     *  @private
+     *  Used to swallow mousedown so bar is not draggable from buttons
+     */
+	private function button_mouseDownHandler(event:MouseEvent):void
+	{
+		event.stopPropagation();
+	}
+
+	/**
+     *  @private
+     */
+	private function minimizeButton_clickHandler(event:Event):void
+	{
+		window.minimize();
+	}
+
+	/**
+     *  @private
+     */
+	private function maximizeButton_clickHandler(event:Event):void
+	{
+		if (window.nativeWindow.displayState ==
+			NativeWindowDisplayState.MAXIMIZED)
+		{
+    		window.restore();
+		}
+    	else
+    	{
+    		window.maximize();
+    		// work around bug  Bug SDK-9547
+    		maximizeButton.dispatchEvent(new MouseEvent(MouseEvent.ROLL_OUT));
+    	}
+    }
+
+	/**
+     *  @private
+     */
+	private function closeButton_clickHandler(event:Event):void
+	{
+		window.close();
+	}
+}
+
+}


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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 18685
Author:   chiedozi@adobe.com
Date:     2010-11-17T23:41:28.244847Z

Log Message:
-----------
MobileApplication classes have been renamed to ViewNavigatorApplication.  Specific file changes are:
MobileApplicationBase  -->  ViewNavigatorApplicationBase
MobileApplication --> ViewNavigatorApplication
MobileApplicationSkin -->  ViewNavigatorApplicationSkin
TabbedMobileApplication -->  TabbedViewNavigatorApplication
TabbedMobileApplicationSkin --> TabbedViewNavigatorApplicationSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedASTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedMXMLLabel.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedViewNavigatorApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/RadioStations/src/RadioStations.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedMXMLTextField.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers/PersistenceManager.as</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/ComponentCatalog/src/ComponentCatalog.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedMobileApplicationSkin.as</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigatorApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchASLabel.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TextTest/src/TextTest.mxml</path>
<path kind="file" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedMobileApplicationSkin.as" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TabbedViewNavigatorApplicationSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchASTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchMXMLLabel.mxml</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/TabbedMobileApplication.as</path>
<path kind="dir" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers/IPersistenceManager.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchMXMLTextField.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TwitterSearch/src/TwitterSearchVirtualizedASLabel.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/tests/performance/mobile/TransitionTests/src/TransitionTests.mxml</path>
<path kind="dir" copyfrom-path="/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/core/managers" copyfrom-rev="18641" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/managers</path>
<path kind="file" action="D">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as
+++ frameworks/projects/mobilecomponents/src/spark/components/ActionBar.as
@@ -205,7 +205,7 @@
 /**
  *  The ActionBar class defines a component that includes title, navigation
  *  and action content groups. In the context of a ViewNavigator and
- *  MobileApplication, the ActionBar is used as application chrome which
+ *  ViewNavigatorApplication, the ActionBar is used as application chrome which
  *  has content contributed by the active View. ActionBar has limited
  *  utility when used otherwise.
  *
@@ -235,7 +235,7 @@
  *  @see SkinnableComponent
  *  @see ViewNavigator
  *  @see View
- *  @see MobileApplication
+ *  @see ViewNavigatorApplication
  *  @see spark.skins.mobile.ActionBarSkin
  *
  *  @langversion 3.0


Transferred from the Adobe Open Source Subversion Repository

Revision: 18437
Author:   jasonsj@adobe.com
Date:     2010-11-03T21:39:54.367666Z

Log Message:
-----------
Fixed paddingBottom handling in TextInput. paddingBottom is only honored if there is room available after paddingTop and vertical alignment.

QE notes: Update mustella known goods
Doc notes:
Bugs:
Reviewer: gruehle
Tests run: checkintests
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/supportClasses/TextSkinBase.as</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
@@ -90,7 +90,7 @@
      *  @private
      *  Default verticalAlign="top"
      */
-    override mx_internal function getTextTop(unscaledHeight:Number, paddingTop:Number):Number
+    override mx_internal function getTextTop(unscaledHeight:Number, paddingTop:Number, paddingBottom:Number):Number
     {
         return paddingTop;
     }


Transferred from the Adobe Open Source Subversion Repository

Revision: 17447
Author:   gruehle@adobe.com
Date:     2010-08-23T20:37:36.438457Z

Log Message:
-----------
Text skin bug fixes:
* TextAreaSkin - add commitStyles() to the beginning of measure(). Fixes problem where changing a size-related style wasn't measuring correctly.
* TextInputSkin - center the textDisplay vertically

Add new (empty) spark.css to the Mobile theme directory, and change airmobile-config.xml to use this one instead of the one in the Spark theme directory. This fixes a pile of CSS warnings. This is a temporary fix until we have scrubbed all of our style metadata to add theme="mobile" (planned for post-beta).

QE notes: none
Doc notes: none
Bugs: SDK-26826, SDK-27522, SDK-27496
Reviewer: Jason Szeto
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/themes/Mobile</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/TextInputSkin.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/themes/Mobile/spark.css</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/airmobile-config.xml</path>

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

--- frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
+++ frameworks/projects/mobiletheme/src/spark/skins/mobile/TextAreaSkin.as
@@ -106,6 +106,7 @@
         //
         // You can set an explicit width and the height will adjust accordingly. The opposite
         // is not true: setting an explicit height will not adjust the width accordingly.
+        textDisplay.commitStyles();
         measuredWidth = 440;
         measuredHeight = Math.max(textDisplay.textHeight + (VERTICAL_PADDING * 2), 55);
     }


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

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

 package spark.components.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 17943
Author:   jszeto@adobe.com
Date:     2010-09-29T22:22:15.975011Z

Log Message:
-----------
ViewMenu initial checkin

Implemented ViewMenu, ViewMenuItem, ViewMenuLayout and all relevant skins.
Integrated into MobileApplicationBase and MobileApplication
Includes PARB review changes
Appearance will change once the visual design has been completed

QE notes: Ready to test!
Doc notes: Needs an ASDoc pass
Bugs: none
Reviewer: Glenn
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/manifest.xml</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/layouts/ViewMenuLayout.as</path>
<path kind="dir" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/layouts</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuItemSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/defaults.css</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenuItem.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewMenu.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/MobileApplicationBase.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/MobileThemeClasses.as</path>
<path kind="file" action="A">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewMenuSkin.mxml</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/MobileApplicationSkin.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
+++ frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorApplicationBase.as
@@ -12,19 +12,25 @@
 package spark.components.supportClasses
 {
 import flash.desktop.NativeApplication;
+import flash.display.InteractiveObject;
 import flash.display.StageOrientation;
 import flash.events.Event;
 import flash.events.InvokeEvent;
 import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
 import flash.events.StageOrientationEvent;
 import flash.system.Capabilities;
 import flash.ui.Keyboard;

+import mx.core.IFactory;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
+import mx.events.FlexMouseEvent;
+import mx.managers.PopUpManager;

 import spark.components.Application;
 import spark.components.View;
+import spark.components.ViewMenu;
 import spark.core.managers.IPersistenceManager;
 import spark.core.managers.PersistenceManager;

@@ -82,6 +88,18 @@

     //--------------------------------------------------------------------------
     //
+    //  Skin Parts
+    //
+    //--------------------------------------------------------------------------
+
+    [SkinPart(required="false")]
+    /**
+     *  Creates an action menu from this factory when the menu button is pressed
+     */
+    public var viewMenu:IFactory;
+
+    //--------------------------------------------------------------------------
+    //
     //  Variables
     //
     //--------------------------------------------------------------------------
@@ -93,6 +111,15 @@
      */
     private var backKeyEventPreventDefaulted:Boolean = false;

+    /**
+     *  @private
+     *  This flag indicates when a user has called preventDefault on the
+     *  KeyboardEvent dispatched when the menu key is pressed.
+     */
+    private var menuKeyEventPreventDefaulted:Boolean = false;
+
+    private var currentViewMenu:ViewMenu;
+    private var lastFocus:InteractiveObject;
     //----------------------------------
     //  activeView
     //----------------------------------
@@ -110,6 +137,26 @@
     //  Properties
     //
     //--------------------------------------------------------------------------
+
+    private var _viewMenuOpen:Boolean = false;
+
+    public function get viewMenuOpen():Boolean
+    {
+        return _viewMenuOpen;
+    }
+
+    public function set viewMenuOpen(value:Boolean):void
+    {
+        if (value == _viewMenuOpen)
+            return;
+
+        _viewMenuOpen = value;
+
+        if (_viewMenuOpen)
+            openViewMenu();
+        else
+            closeViewMenu();
+    }

     //----------------------------------
     //  landscapeOrientation
@@ -289,6 +336,20 @@
     }

     /**
+     *  Called when the menu key is pressed. By default, this opens or closes
+     *  the ViewMenu.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function menuKeyHandler(event:KeyboardEvent):void
+    {
+        viewMenuOpen = !viewMenuOpen;
+    }
+
+    /**
      *  @private
      */
     // FIXME (chiedozi): Maybe use a singleton for persistence, PARB (GLENN)
@@ -305,7 +366,19 @@
      *  @productversion Flex 4.5
      */
     protected function orientationChangeHandler(event:StageOrientationEvent):void
-    {
+    {
+        if (viewMenuOpen)
+        {
+            // Change the width
+            // Reposition
+            currentViewMenu.width = getLayoutBoundsWidth();
+
+
+            currentViewMenu.validateNow();
+
+            currentViewMenu.x = 0;
+            currentViewMenu.y = Math.ceil(getLayoutBoundsHeight() - currentViewMenu.getLayoutBoundsHeight());
+        }
     }

     /**
@@ -365,6 +438,14 @@
             if (canCancelBackKeyBehavior)
                 event.preventDefault();
         }
+        else if (key == Keyboard.MENU)
+        {
+            menuKeyEventPreventDefaulted = event.isDefaultPrevented();
+
+            if (menuKeyEventPreventDefaulted)
+                event.preventDefault();
+        }
+
     }

     /**
@@ -383,6 +464,51 @@
         // deviceKeyDownHandler method and so doesn't need to be reset.
         if (key == Keyboard.BACK && !backKeyEventPreventDefaulted && canCancelBackKeyBehavior)
             backKeyHandler();
+        else if (key == Keyboard.MENU && !menuKeyEventPreventDefaulted)
+            menuKeyHandler(event);
+    }
+
+    private function viewMenu_clickHandler(event:MouseEvent):void
+    {
+        viewMenuOpen = false;
+    }
+
+    private function viewMenu_mouseDownOutsideHandler(event:FlexMouseEvent):void
+    {
+        viewMenuOpen = false;
+    }
+
+    private function openViewMenu():void
+    {
+        currentViewMenu = ViewMenu(viewMenu.newInstance());
+        currentViewMenu.items = activeView.viewMenuItems;
+        currentViewMenu.owner = this;
+        currentViewMenu.addEventListener(MouseEvent.CLICK, viewMenu_clickHandler);
+        currentViewMenu.width = getLayoutBoundsWidth();
+
+        PopUpManager.addPopUp(currentViewMenu, this, true);
+        currentViewMenu.validateNow();
+
+        currentViewMenu.x = 0;
+        currentViewMenu.y = Math.ceil(getLayoutBoundsHeight() - currentViewMenu.getLayoutBoundsHeight());
+
+        lastFocus = getFocus();
+
+        currentViewMenu.setFocus();
+        currentViewMenu.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, viewMenu_mouseDownOutsideHandler);
+    }
+
+    private function closeViewMenu():void
+    {
+        currentViewMenu.removeEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, viewMenu_mouseDownOutsideHandler);
+        PopUpManager.removePopUp(currentViewMenu);
+        currentViewMenu.caretIndex = -1;
+        currentViewMenu.validateProperties();
+        currentViewMenu.removeEventListener(MouseEvent.CLICK, viewMenu_clickHandler);
+        currentViewMenu.items = null;
+        currentViewMenu = null;
+
+        systemManager.stage.focus = lastFocus;
     }

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


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

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

 package mx.validators
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 17169
Author:   chiedozi@adobe.com
Date:     2010-08-03T19:06:37.348954Z

Log Message:
-----------
Added the ability to show and hide the action bar and tab bar in ViewNavigator and View
Added the ability for a navigator to swtich between overlay modes
Added tabBar and overlay support to SlideViewTransition
Added overlay support to default ViewNavigatorSkin

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

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/IViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/View.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/FlipViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/MobileApplication.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/effects/SlideViewTransition.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobiletheme/src/spark/skins/mobile/ViewNavigatorSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/mobilecomponents/src/spark/components/ViewNavigator.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/View.as
+++ frameworks/projects/mobilecomponents/src/spark/components/View.as
@@ -29,9 +29,9 @@
  *  Dispatched when the data property changes.
  *
  *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  *
  *  @eventType mx.events.FlexEvent.DATA_CHANGE
  *
@@ -44,9 +44,9 @@
  *  @eventType mx.events.FlexEvent.VIEW_ACTIVATE
  *
  *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [Event(name="viewActivate", type="mx.events.FlexEvent")]

@@ -56,9 +56,9 @@
  *  @eventType mx.events.FlexEvent.VIEW_DEACTIVATE
  *
  *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [Event(name="viewDeactivate", type="mx.events.FlexEvent")]

@@ -70,9 +70,9 @@
  *  @eventType mx.events.FlexEvent.REMOVING
  *
  *  @langversion 3.0
- *  @playerversion Flash 9
- *  @playerversion AIR 1.1
- *  @productversion Flex 3
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 [Event(name="removing", type="mx.events.FlexEvent")]

@@ -80,9 +80,9 @@
 /**
  *
  *  @langversion 3.0
- *  @playerversion Flash 10
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
+ *  @playerversion Flash 10.1
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
  */
 public class View extends Group implements IDataRenderer
 {
@@ -96,9 +96,9 @@
      *  Constructor.
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function View()
     {
@@ -122,7 +122,18 @@
     private var _active:Boolean = false;

     /**
-     * Flag indicating whether the current screen is active.
+     *  Flag indicating whether the current screen is active.  The
+     *  view's navigator will automatically set this flag to true
+     *  or false as its state changes.  This getter will dispatch
+     *  FlexEvent.VIEW_ACTIVATE and FlexEvent.VIEW_DEACTIVATE
+     *  as the value changes.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get active() : Boolean
     {
@@ -149,13 +160,20 @@
     //----------------------------------

     /**
+     *  @private
+     *
      *  Determines if the current view can be removed by
      *  a navigator.  The default implementation dispatches
      *  a FlexEvent.REMOVING event.  If
      *  preventDefault() is called on the event, this property
      *  will be set to false.
      *
-     *  @return Returns true if the screen can be removed
+     *  @return Returns true if the screen can be removed
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     mx_internal function get canRemove():Boolean
     {
@@ -169,6 +187,44 @@
     }

     //----------------------------------
+    //  overlayControls
+    //----------------------------------
+
+    private var _overlayControls:Boolean = false;
+
+    /**
+     *  Determines the way the view's navigator's ui controls
+     *  should lay out in relation to the view content.  If
+     *  set to true, the ui controls will hover on top of the
+     *  view.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get overlayControls():Boolean
+    {
+        return _overlayControls;
+    }
+
+    /**
+     *  @private
+     */
+    public function set overlayControls(value:Boolean):void
+    {
+        if (_overlayControls != value)
+        {
+            _overlayControls = value;
+
+            if (navigator)
+                navigator.overlayControls = _overlayControls;
+        }
+    }
+
+    //----------------------------------
     //  desctructionPolicy
     //----------------------------------

@@ -181,6 +237,11 @@
      *  view will be cached in memory.
      *
      *  @default auto
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get destructionPolicy():String
     {
@@ -204,6 +265,11 @@
     [Bindable]
     /**
      * The view's navigator.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get navigator():ViewNavigator
     {
@@ -223,8 +289,15 @@
     private var _returnedObject:Object;

     /**
-     *
-     *
+     *  An object that was returned by the previous view when
+     *  the navigator is popping back to this view.
+     *
+     *  @default null
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     [Bindable]
     public function get returnedObject():Object
@@ -260,7 +333,7 @@
      *  @default null
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10
+     *  @playerversion Flash 10.1
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
@@ -290,7 +363,7 @@
      *  @default null
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10
+     *  @playerversion Flash 10.1
      *  @playerversion AIR 2.5
      *  @productversion Flex 4.5
      */
@@ -377,7 +450,86 @@
         _navigationGroupLayout = value;
         dispatchEvent(changeEvent);
     }
-
+
+	//----------------------------------
+	//  showActionBar
+	//----------------------------------
+	private var _showActionBar:Boolean = true;
+
+	/**
+	 *  Flag indicating whether a view should show the action bar or not.
+	 *  This doesn't necessarily correlate to the visible property of the
+	 *  navigator's ActionBar.  In the end, ViewNavigator and the developer
+	 *  have the last say as to what's visible.
+	 *
+	 *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+	 */
+	public function get showActionBar():Boolean
+	{
+		return _showActionBar;
+	}
+
+    /**
+     *  @private
+     */
+	public function set showActionBar(value:Boolean):void
+	{
+		_showActionBar = value;
+
+		// Immediately request actionBar's visibility be toggled
+		if (active && navigator)
+		{
+			if (_showActionBar)
+				navigator.showActionBar();
+			else
+				navigator.hideActionBar();
+		}
+	}
+	//----------------------------------
+	//  showTabBar
+	//----------------------------------
+	private var _showTabBar:Boolean = true;
+
+	/**
+	 *  Flag indicating whether a view should show the action bar or not.
+	 *  This doesn't necessarily correlate to the visible property of the
+	 *  navigator's ActionBar.  In the end, ViewNavigator and the developer
+	 *  have the last say as to what's visible.
+	 *
+	 *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+	 */
+	public function get showTabBar():Boolean
+	{
+		return _showTabBar;
+	}
+
+    /**
+     *  @private
+     */
+	public function set showTabBar(value:Boolean):void
+	{
+		_showTabBar = value;
+
+		// Immediately request actionBar's visibility be toggled
+		if (active && navigator)
+		{
+			if (_showTabBar)
+				navigator.showTabBar();
+			else
+				navigator.hideTabBar();
+		}
+	}
+
     //----------------------------------
     //  title
     //----------------------------------
@@ -386,7 +538,12 @@

     [Bindable]
     /**
-     *
+     *  The title for the view.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get title():String
     {
@@ -491,6 +648,10 @@
     /**
      *  The data associated with the current view.
      *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.1
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
      */
     public function get data():Object
     {
@@ -515,6 +676,11 @@
     //--------------------------------------------------------------------------

     /**
+     *  Methods creates an object that should be returned to the
+     *  previous screen when this view is popped off a navigator's
+     *  stack.
+     *
+     *  @return null
      *
      *  @langversion 3.0
      *  @playerversion Flash 10.1
@@ -527,6 +693,8 @@
     }

     /**
+     *  Returns the state the view should be in based on the orientation
+     *  of the device.
      *
      *  @return A String specifying the name of the state to apply to the screen.
      *


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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


Transferred from the Adobe Open Source Subversion Repository

Revision: 8486
Author:   smgilson@adobe.com
Date:     2009-07-09T18:42:45.734868Z

Log Message:
-----------
Third checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/Range.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/Range.as
@@ -32,7 +32,7 @@
  *
  *  @mxml
  *
- *
The <Range> tag inherits all of the tag
+ *
The <s:Range> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:

  *
  *


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as
+++ frameworks/projects/spark/src/spark/skins/spark/DefaultItemRenderer.as
@@ -241,7 +241,8 @@
     {
         _data = value;

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

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


added missing parameter documentation

added missing parameter documentation

Change-Id: I0f8501187b15ab1b070842df88206a76318506eb

--- WeaveAPI/src/weave/api/data/IAttributeColumn.as
+++ WeaveAPI/src/weave/api/data/IAttributeColumn.as
@@ -41,6 +41,7 @@
 		/**
 		 * This function gets a value associated with a record key.
 		 * @param key A record key.
+		 * @param dataType The desired value type (Examples: Number, String, Date, Array, IQualifiedKey)
 		 * @return The value associated with the given record key.
 		 */
 		function getValueFromKey(key:IQualifiedKey, dataType:Class = null):*;


ignoring .weave/.xml files inside .zip files

--- WeaveUI/src/weave/application/VisApplication.as
+++ WeaveUI/src/weave/application/VisApplication.as
@@ -762,7 +762,7 @@
 			]
 		}

-		public function handleDraggedFile(fileName:String, fileContent:ByteArray):void
+		public function handleDraggedFile(fileName:String, fileContent:ByteArray, dataFilesOnly:Boolean = false):void
 		{
 			var ext:String = String(fileName.split('.').pop()).toLowerCase();
 			var adsp:AddDataSourcePanel;
@@ -772,7 +772,7 @@
 			{
 				var files:Object = weave.flascc.readZip(fileContent);
 				for (var fileName:String in files)
-					handleDraggedFile(fileName, files[fileName]);
+					handleDraggedFile(fileName, files[fileName], true);

 				adsp = DraggablePanel.getStaticInstance(AddDataSourcePanel);
 				if (adsp.parent)
@@ -781,7 +781,7 @@
 				return;
 			}

-			if (ext == 'weave' || ext == 'xml')
+			if (!dataFilesOnly && (ext == 'weave' || ext == 'xml'))
 			{
 				loadSessionState(fileContent, fileName);
 				return;