Transferred from the Adobe Open Source Subversion Repository

Revision: 5223
Author:   egeorgie@adobe.com
Date:     2009-03-10T20:10:07.223108Z

Log Message:
-----------
Introduce ButtonBase and ToggleButtonBase classes and make FxButton extend ButtonBase, ToggleButtonBase extend ButtonBase, FxToggleButton, FxCheckBox, FxRadioButton extend ToggleButtonBase.as.
The emphasized property and IButton are pushed down to the FxButton, so the rest of the buttons don't have them.

QE Notes: None
Doc Notes:
Bugs: SDK-19671, SDK-19670
Reviewer: Glenn
tests: checkintests, mustella (gumbo/components)

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxCheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxRadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/mxml-2009-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/defaults.css</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/ButtonBarButton.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/ButtonBase.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/ToggleButtonBase.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as
@@ -0,0 +1,940 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.components.baseClasses
+{
+
+import flash.events.Event;
+import flash.events.FocusEvent;
+import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
+import flash.events.TimerEvent;
+import flash.ui.Keyboard;
+import flash.utils.Timer;
+
+import mx.components.baseClasses.FxComponent;
+import mx.events.FlexEvent;
+import mx.events.SandboxMouseEvent;
+import mx.graphics.baseClasses.TextGraphicElement;
+import mx.managers.IFocusManagerComponent;
+import mx.utils.StringUtil;
+
+include "../../styles/metadata/BasicTextLayoutFormatStyles.as"
+
+/**
+ *  @copy mx.components.baseClasses.GroupBase#focusColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="focusColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Dispatched when the user presses the ButtonBase control.
+ *  If the autoRepeat property is true,
+ *  this event is dispatched repeatedly as long as the button stays down.
+ *
+ *  @eventType mx.events.FlexEvent.BUTTON_DOWN
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Event(name="buttonDown", type="mx.events.FlexEvent")]
+
+/**
+ *  Number of milliseconds to wait after the first buttonDown
+ *  event before repeating buttonDown events at each
+ *  repeatInterval.
+ *
+ *  @default 500
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="repeatDelay", type="Number", format="Time", inherit="no")]
+
+/**
+ *  Number of milliseconds between buttonDown events
+ *  if the user presses and holds the mouse on a button.
+ *
+ *  @default 35
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="repeatInterval", type="Number", format="Time", inherit="no")]
+
+/**
+ *  Up State of the Button
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[SkinState("up")]
+
+/**
+ *  Over State of the Button
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[SkinState("over")]
+
+/**
+ *  Down State of the Button
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[SkinState("down")]
+
+/**
+ *  Disabled State of the Button
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[SkinState("disabled")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+[DefaultTriggerEvent("click")]
+
+[DefaultProperty("label")]
+
+/**
+ *  The ButtonBase component is the base class for the all Spark button components.
+ *  FxButton and ToggleButtonBase are subclasses of ButtonBase.
+ *  FxToggleButton, FxCheckBox and FxRadioButton are subclasses of ToggleButtonBase.
+ *
+ *  @see mx.components.FxButton
+ *  @see mx.components.baseClasses.ToggleButtonBase
+ *  @see mx.components.FxToggleButton
+ *  @see mx.components.FxCheckBox
+ *  @see mx.components.FxRadioButton
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+public class ButtonBase extends FxComponent implements IFocusManagerComponent
+{
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function ButtonBase()
+    {
+        super();
+
+        // DisplayObjectContainer properties.
+        // Setting mouseChildren to false ensures that mouse events
+        // are dispatched from the Button itself,
+        // not from its skins, icons, or TextField.
+        // One reason for doing this is that if you press the mouse button
+        // while over the TextField and release the mouse button while over
+        // a skin or icon, we want the player to dispatch a "click" event.
+        // Another is that if mouseChildren were true and someone uses
+        // Sprites rather than Shapes for the skins or icons,
+        // then we we wouldn't get a click because the current skin or icon
+        // changes between the mouseDown and the mouseUp.
+        // (This doesn't happen even when mouseChildren is true if the skins
+        // and icons are Shapes, because Shapes never dispatch mouse events;
+        // they are dispatched from the Button in this case.)
+        mouseChildren = false;
+
+        // add event listeners to the button
+        addHandlers();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Skin Parts
+    //
+    //--------------------------------------------------------------------------
+
+    [SkinPart(required="false")]
+
+    /**
+     *  A skin part that defines the  label of the button.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public var labelElement:TextGraphicElement;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  content
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the content property.
+     */
+    private var _content:Object;
+
+    [Bindable("contentChange")]
+
+    /**
+     *  The content property lets you pass an arbitrary object
+     *  to be used in a custom skin of the button.
+     *
+     *  When a skin defines the optional part labelElement then
+     *  a string representation of content will be pushed down to
+     *  that part's text property.
+     *
+     *  The default skin uses this mechanism to render the content
+     *  as the button label.
+     *
+     *
The label property is a String typed
+     *  facade of this property.  This property is bindable and it shares
+     *  the "contentChange" event with the label property.

+     *
+     *  @default null
+     *  @eventType contentChange
+     *  @see #label
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get content():Object
+    {
+        return _content;
+    }
+
+    /**
+     *  @private
+     */
+    public function set content(value:Object):void
+    {
+        _content = value;
+
+        // Push to the optional labelElement skin part
+        if (labelElement)
+            labelElement.text = label;
+        dispatchEvent(new Event("contentChange"));
+    }
+
+    //----------------------------------
+    //  label
+    //----------------------------------
+
+    [Bindable("contentChange")]
+
+    /**
+     *  Text to appear on the ButtonBase control.
+     *
+     *
If the label is wider than the ButtonBase control,
+     *  the label is truncated and terminated by an ellipsis (...).
+     *  The full label displays as a tooltip
+     *  when the user moves the mouse over the control.
+     *  If you have also set a tooltip by using the tooltip
+     *  property, the tooltip is displayed rather than the label text.

+     *
+     *
This is the default ButtonBase property.

+     *
+     *
This property is a String typed facade to the
+     *  content property.  This property is bindable and it shares
+     *  dispatching the "contentChange" event with the content
+     *  property.

+     *
+     *  @default ""
+     *  @see #content
+     *  @eventType contentChange
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function set label(value:String):void
+    {
+        // label property is just a proxy to the content.
+        // The content setter will dispatch the event.
+        content = value;
+    }
+
+    /**
+     *  @private
+     */
+    public function get label():String
+    {
+        return (content != null) ? content.toString() : "";
+    }
+
+    //----------------------------------
+    //  hovered
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the hovered property
+     */
+    private var _hovered:Boolean = false;
+
+    /**
+     *  Indicates whether the mouse pointer is over the button.
+     *  Used to determine the skin state.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function get hovered():Boolean
+    {
+        return _hovered;
+    }
+
+    /**
+     *  @private
+     */
+    protected function set hovered(value:Boolean):void
+    {
+        if (value == _hovered)
+            return;
+
+        _hovered = value;
+        invalidateButtonState();
+    }
+
+    //----------------------------------
+    //  mouseCaptured
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the mouseCaptured property
+     */
+    private var _mouseCaptured:Boolean = false;
+
+    /**
+     *  Indicates whether the mouse is down and the mouse pointer was
+     *  over the button when MouseEvent.MOUSE_DOWN was first dispatched.
+     *  Used to determine the skin state.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function get mouseCaptured():Boolean
+    {
+        return _mouseCaptured;
+    }
+
+    /**
+     *  @private
+     */
+    protected function set mouseCaptured(value:Boolean):void
+    {
+        if (value == _mouseCaptured)
+            return;
+
+        _mouseCaptured = value;
+        invalidateButtonState();
+
+        // System mouse handlers are not needed when the button is not mouse captured
+        if (!value)
+            removeSystemMouseHandlers();
+    }
+
+    /**
+     *  @private
+     */
+    override public function set enabled(value:Boolean):void
+    {
+        if (enabled == value)
+            return;
+
+        super.enabled = value;
+        invalidateButtonState();
+    }
+
+    //----------------------------------
+    //  keyboardPressed
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the keyboardPressed property
+     */
+    private var _keyboardPressed:Boolean = false;
+
+    /**
+     *  Indicates whether a keyboard key is pressed while the button is in focus.
+     *  Used to determine the skin state.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function get keyboardPressed():Boolean
+    {
+        return _keyboardPressed;
+    }
+
+    /**
+     *  @private
+     */
+    protected function set keyboardPressed(value:Boolean):void
+    {
+        if (value == _keyboardPressed)
+            return;
+
+        _keyboardPressed = value;
+        invalidateButtonState();
+    }
+
+    //----------------------------------
+    //  stickyHighlighting
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the stickyHighlighting property
+     */
+    private var _stickyHighlighting:Boolean = false;
+
+    /**
+     *  If false, the button displays its down skin
+     *  when the user presses it but changes to its over skin when
+     *  the user drags the mouse off of it.
+     *  If true, the button displays its down skin
+     *  when the user presses it, and continues to display this skin
+     *  when the user drags the mouse off of it.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get stickyHighlighting():Boolean
+    {
+        return _stickyHighlighting
+    }
+
+    /**
+     *  @private
+     */
+    public function set stickyHighlighting(value:Boolean):void
+    {
+        if (value == _stickyHighlighting)
+            return;
+
+        _stickyHighlighting = value;
+        invalidateButtonState();
+    }
+
+    //----------------------------------
+    //  autoRepeat
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _autoRepeat:Boolean;
+
+    [Inspectable(defaultValue="false")]
+
+    /**
+     *  Specifies whether to dispatch repeated buttonDown
+     *  events if the user holds down the mouse button.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get autoRepeat():Boolean
+    {
+        return _autoRepeat;
+    }
+
+    /**
+     *  @private
+     */
+    public function set autoRepeat(value:Boolean):void
+    {
+        if (value == _autoRepeat)
+            return;
+
+        _autoRepeat = value;
+        checkAutoRepeatTimerConditions(isDown());
+    }
+
+    //----------------------------------
+    //  toolTip
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="null")]
+
+    private var _explicitToolTip:Boolean = false;
+
+    /**
+     *  @private
+     */
+    override public function set toolTip(value:String):void
+    {
+        super.toolTip = value;
+
+        // If explicit tooltip is cleared, we need to make sure our
+        // updateDisplayList is called, so that we add automatic tooltip
+        // in case the label is truncated.
+        if (_explicitToolTip && !value)
+            invalidateDisplayList();
+
+        _explicitToolTip = value != null;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  baselinePosition
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    override public function get baselinePosition():Number
+    {
+        return getBaselinePositionForPart(labelElement);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function partAdded(partName:String, instance:Object):void
+    {
+        super.partAdded(partName, instance);
+
+        if (instance == labelElement)
+        {
+            labelElement.text = label;
+
+            // Temporary ...
+            labelElement.setStyle("verticalAlign", getStyle("verticalAlign"));
+        }
+    }
+
+    /**
+     *  @private
+     *  Remember whether we have fired an event already,
+     *  so that we don't fire a second time.
+     */
+    private var _downEventFired:Boolean = false;
+
+    /**
+     *  @private
+     */
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+
+        if (checkForButtonDownConditions)
+        {
+            var isCurrentlyDown:Boolean = isDown();
+
+            // Only if down state has changed, do we need to do something
+            if (_downEventFired != isCurrentlyDown)
+            {
+                if (isCurrentlyDown)
+                    dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
+
+                _downEventFired = isCurrentlyDown;
+                checkAutoRepeatTimerConditions(isCurrentlyDown);
+            }
+
+            checkForButtonDownConditions = false;
+        }
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  States
+    //
+    //--------------------------------------------------------------------------
+
+    private function isDown():Boolean
+    {
+        if (!enabled)
+            return false;
+
+        if (keyboardPressed)
+            return true;
+
+        if (mouseCaptured && (hovered || stickyHighlighting))
+            return true;
+        return false;
+    }
+
+    /**
+     *  @private
+     *  Marks the button state invalid, so that the button skin's state
+     *  can be set properly and "buttonDown" events can be dispatched where
+     *  appropriate.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    private function invalidateButtonState():void
+    {
+        checkForButtonDownConditions = true;
+        invalidateProperties();
+        invalidateSkinState();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function getCurrentSkinState():String
+    {
+        if (!enabled)
+            return "disabled";
+
+        if (isDown())
+            return "down";
+
+        if (hovered || mouseCaptured)
+            return "over";
+
+        return "up";
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event handling
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    protected function addHandlers():void
+    {
+        addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler);
+        addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler);
+        addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler);
+        addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler);
+        addEventListener(MouseEvent.CLICK, mouseEventHandler);
+    }
+
+    /**
+     *  @private
+     *  This method adds the mouseEventHandler as an event listener to
+     *  the stage and the systemManager so that it gets called even if mouse events
+     *  are dispatched outside of the button. This is needed for example when the
+     *  user presses the button, drags out and releases the button.
+     */
+    private function addSystemMouseHandlers():void
+    {
+        systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, true /*useCapture*/);
+        systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseEventHandler);
+    }
+
+    /**
+     *  @private
+     *  This method removes the mouseEventHandler as an event listener from
+     *  the stage and the systemManager.
+     */
+    private function removeSystemMouseHandlers():void
+    {
+        systemManager.getSandboxRoot().removeEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, true /*useCapture*/);
+        systemManager.getSandboxRoot().removeEventListener(SandboxMouseEvent.MOUSE_UP_SOMEWHERE, mouseEventHandler);
+    }
+
+    /**
+     *  This method handles the mouse events, calls the clickHandler method
+     *  where appropriate and updates the hovered and
+     *  mouseCaptured properties.
+     *
This method gets called to handle MouseEvent.ROLL_OVER, MouseEvent.ROLL_OUT,
+     *  MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP, MouseEvent.CLICK and
+     *  SandboxMouseEvent.MOUSE_UP_SOMEWHERE.

+     *
For MouseEvent.MOUSE_UP and SandboxMouseEvent.MOUSE_UP_SOMEWHERE, the event
+     *  target can be other than the ButtonBase - for example when the user presses the
+     *  ButtonBase, we listen for MOUSE_UP and MOUSE_UP_SOMEWHERE to handle cases where the user drags
+     *  outside the ButtonBase and releases the mouse.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function mouseEventHandler(event:Event):void
+    {
+        var mouseEvent:MouseEvent = event as MouseEvent;
+        switch (event.type)
+        {
+            case MouseEvent.ROLL_OVER:
+            {
+                // if the user rolls over while holding the mouse button
+                if (mouseEvent.buttonDown && !mouseCaptured)
+                    return;
+                    hovered = true;
+                break;
+            }
+
+            case MouseEvent.ROLL_OUT:
+            {
+                hovered = false;
+                break;
+            }
+
+            case MouseEvent.MOUSE_DOWN:
+            {
+                // When the button is down we need to listen for mouse events outsied the button so that
+                // we update the state appropriately on mouse up.  Whenever mouseCaptured changes to false,
+                // it will take care to remove those handlers.
+                addSystemMouseHandlers();
+                mouseCaptured = true;
+                break;
+            }
+
+            case MouseEvent.MOUSE_UP:
+            {
+                if (event.currentTarget == this)
+                    hovered = true;
+            } //fallthrough:
+            case SandboxMouseEvent.MOUSE_UP_SOMEWHERE:
+            {
+                mouseCaptured = false;
+                break;
+            }
+
+            // Prevent the propagation of click from a disabled Button.
+            // This is conceptually a higher-level event and
+            // developers will expect their click handlers not to fire
+            // if the Button is disabled.
+            case MouseEvent.CLICK:
+            {
+                if (!enabled)
+                    event.stopImmediatePropagation();
+                else
+                    clickHandler(MouseEvent(event));
+                return;
+            }
+        }
+        if (mouseEvent)
+            mouseEvent.updateAfterEvent();
+    }
+
+    /**
+     *  Override in subclasses to handle the click event rather than
+     *  adding a separate handler. clickHandler will not get called if the
+     *  button is disabled.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    protected function clickHandler(event:MouseEvent):void
+    {
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: UIComponent
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override protected function focusOutHandler(event:FocusEvent):void
+    {
+        // Most of the time the system sends a rollout, but there are
+        // situations where the mouse is over something else
+        // that you don't get one so we force one on FOCUS_OUT.
+        super.focusOutHandler(event);
+
+        mouseCaptured = false;
+        keyboardPressed = false;
+    }
+
+    /**
+     *  @private
+     */
+    override protected function keyDownHandler(event:KeyboardEvent):void
+    {
+        if (event.keyCode != Keyboard.SPACE)
+            return;
+        keyboardPressed = true;
+        event.updateAfterEvent();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function keyUpHandler(event:KeyboardEvent):void
+    {
+        if (event.keyCode != Keyboard.SPACE)
+            return;
+        keyboardPressed = false;
+
+        if (enabled)
+            dispatchEvent(new MouseEvent(MouseEvent.CLICK));
+        event.updateAfterEvent();
+    }
+
+    /**
+     *  @private
+     *  true when we need to check whether to dispatch
+     *  a button down event
+     */
+    private var checkForButtonDownConditions:Boolean = false;
+
+    /**
+     *  @private
+     *  Timer for doing auto-repeat.
+     */
+    private var autoRepeatTimer:Timer;
+
+    /**
+     *  @private
+     */
+    private function checkAutoRepeatTimerConditions(buttonDown:Boolean):void
+    {
+        var needsTimer:Boolean = autoRepeat && buttonDown;
+        var hasTimer:Boolean = autoRepeatTimer != null;
+
+        if (needsTimer == hasTimer)
+            return;
+
+        if (needsTimer)
+            startTimer();
+        else
+            stopTimer();
+    }
+
+    /**
+     *  @private
+     */
+    private function startTimer():void
+    {
+        autoRepeatTimer = new Timer(1);
+        autoRepeatTimer.delay = getStyle("repeatDelay");
+        autoRepeatTimer.addEventListener(TimerEvent.TIMER, autoRepeat_timerDelayHandler);
+        autoRepeatTimer.start();
+    }
+
+    /**
+     *  @private
+     */
+    private function stopTimer():void
+    {
+        autoRepeatTimer.stop();
+        autoRepeatTimer = null;
+    }
+
+    /**
+     *  @private
+     */
+    private function autoRepeat_timerDelayHandler(event:TimerEvent):void
+    {
+        autoRepeatTimer.reset();
+        autoRepeatTimer.removeEventListener( TimerEvent.TIMER, autoRepeat_timerDelayHandler);
+
+        autoRepeatTimer.delay = getStyle("repeatInterval");
+        autoRepeatTimer.addEventListener( TimerEvent.TIMER, autoRepeat_timerHandler);
+        autoRepeatTimer.start();
+    }
+
+    /**
+     *  @private
+     */
+    private function autoRepeat_timerHandler(event:TimerEvent):void
+    {
+        dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // Bail out if we don't have a label or the tooltip is explicitly set.
+        if (!labelElement || _explicitToolTip)
+            return;
+
+        // Check if the label text is truncated
+        // TODO EGeorgie: use TextGraphicElement API to check for truncated text.
+        labelElement.validateNow();
+        var truncated:Boolean = labelElement.getLayoutBoundsWidth() < labelElement.getPreferredBoundsWidth() ||
+                                labelElement.getLayoutBoundsHeight() < labelElement.getPreferredBoundsHeight();
+
+        // If the label is truncated, show the whole label string as a tooltip
+        super.toolTip = truncated ? labelElement.text : null;
+    }
+}
+
+}


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

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

 package spark.components.supportClasses
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 4960
Author:   gosmith@adobe.com
Date:     2009-02-14T02:23:27.721068Z

Log Message:
-----------
Decreased the number of Gumbo style buckets.

Combined AdvancedCharacterFormatTextStyles.as, AdvancedParagraphFormatTextStyles.as, and AdvancedContainerFormatTextStyles.as into AdvancedTextLayoutFormatStyles.as.

Combined BasicCharacterFormatTextStyles.as, BasicParagraphFormatTextStyles.as, and BasicContainerFormatTextStyles.as into BasicTextLayoutFormatStyles.as.

The reason for doing this is that TLF combined its CharacterFormat, ParagraphFormat, and ContainerFormat classes into a single TextLayoutFormat.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: None; no functional change

Modified Paths:
--------------
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxScroller.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicContainerFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedParagraphFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextGraphic.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicCharacterFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxTextBase.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicParagraphFormatTextStyles.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/AdvancedContainerFormatTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/TextBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxDataContainer.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/styles/metadata/BasicTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/TextView.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as</path>

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -25,9 +25,7 @@
 import mx.formatters.NumberFormatter;
 import mx.managers.IFocusManagerComponent;

-include "../../styles/metadata/BasicContainerFormatTextStyles.as"
-include "../../styles/metadata/BasicParagraphFormatTextStyles.as"
-include "../../styles/metadata/BasicCharacterFormatTextStyles.as"
+include "../../styles/metadata/BasicTextLayoutFormatStyles.as"

 /**
  *  @copy mx.components.baseClasses.GroupBase#focusColor


Transferred from the Adobe Open Source Subversion Repository

Revision: 5098
Author:   gauravj@adobe.com
Date:     2009-02-27T02:21:27.489350Z

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

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

Modified Paths:
--------------
151 paths were modified

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

--- frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
+++ frameworks/projects/spark/src/spark/components/supportClasses/SliderBase.as
@@ -29,6 +29,11 @@

 /**
  *  @copy mx.components.baseClasses.GroupBase#focusColor
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 [Style(name="focusColor", type="uint", format="Color", inherit="yes")]

@@ -38,6 +43,11 @@
  *  The current value of the slider is determined by the relative location of
  *  the thumb between the end points of the slider,
  *  corresponding to the slider's minimum and maximum values.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 10
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
  */
 public class FxSlider extends FxTrackBase implements IFocusManagerComponent
 {
@@ -51,6 +61,11 @@

     /**
      *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function FxSlider():void
     {
@@ -69,6 +84,11 @@
      *  A skin part that defines a dataTip that displays a formatted version of
      *  the current value. The dataTip appears while the thumb is being dragged.
      *  This is a dynamic skin part and must be of type IFactory.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var dataTip:IFactory;

@@ -91,6 +111,11 @@
 	/**
 	 *  The dataTip instance used by subclasses to control its behavior. The instance
 	 *  is non-null only when the dataTip has been popped up.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @productversion Flex 4
 	 */
 	protected var dataTipInstance:IDataRenderer;

@@ -123,6 +148,11 @@
      *

      *
      *  @default undefined
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
 	public function set dataTipFormatFunction(value:Function):void
 	{
@@ -137,6 +167,11 @@
 	/**
 	 *  Starting position of the dataTip. Used by subclasses to
 	 *  position the dataTip.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @productversion Flex 4
 	 */
 	protected var dataTipOriginalPosition:Point;

@@ -149,6 +184,11 @@
 	 *  This value is ignored if dataTipFormatFunction is defined.
 	 *
 	 *  @default 2
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 1.5
+	 *  @productversion Flex 4
 	 */
     public var dataTipPrecision:int = 2;

@@ -164,6 +204,11 @@
      *  of when the thumb button is released.
      *
      *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public function get liveDragging():Boolean
     {
@@ -188,6 +233,11 @@
      *  dataTipFactory must be defined in the skin in order to
      *  display a data tip.
      *  @default true
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     public var showDataTip:Boolean = true;

@@ -270,6 +320,11 @@
      *  track.
      *
      *  @return The posisiton on the track.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     protected function pointClickToPosition(localX:Number,
                                             localY:Number):Number
@@ -281,6 +336,11 @@
      *  Used to position the data tip when it is visible. Subclasses must implement
      *  this function and can use the dataTipOriginalPosition and dataTipInstance
      *  properties.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
      */
     protected function positionDataTip():void
     {


Functions can now be compiled and returned from evaluateExpression().

Change-Id: Id1e96dd33dd75a42ee12bd48e5a007e4ec96b598

--- WeaveCore/src/weave/core/ExternalSessionStateInterface.as
+++ WeaveCore/src/weave/core/ExternalSessionStateInterface.as
@@ -338,19 +338,13 @@
 					compiledObject,
 					[variables, _variables],
 					WeaveAPI.ErrorManager.reportError,
-					thisObject != null
+					thisObject != null,
+					null,
+					null,
+					true,
+					thisObject
 				);
-				var result:*;
-				if (isAssignment && isFuncDef)
-				{
-					// bind 'this' scope
-					result = Compiler.bind(compiledMethod, thisObject);
-				}
-				else
-				{
-					result = compiledMethod.apply(thisObject);
-				}
-
+				var result:* = isFuncDef ? compiledMethod : compiledMethod.apply(thisObject);
 				if (isAssignment)
 					_variables[assignVariableName] = result;
 				else


added workaround for Flash/JavaScript bug

--- WeaveCore/src/weave/core/ExternalSessionStateInterface.as
+++ WeaveCore/src/weave/core/ExternalSessionStateInterface.as
@@ -462,7 +462,10 @@

 		private static function externalError(format:String, ...args):void
 		{
-			throw new Error(StandardLib.substitute(format, args));
+			var str:String = StandardLib.substitute(format, args);
+			// temporary solution for Flash not escaping double-quotes when generating JavaScript throw statement
+			str = StandardLib.replace(str, '"', "'");
+			throw new Error(str);
 		}

 		private static function externalWarning(format:String, ...args):void


Transferred from the Adobe Open Source Subversion Repository

Revision: 3497
Author:   clucier@adobe.com
Date:     2008-10-06T21:48:38.510473Z

Log Message:
-----------
Changing internal datastructure utilized by the LayoutManager's priority queue, in order to provide a mechanism for quicker lookup of items being validated with 'ValidateNow/ValidateClient'.  Will be keeping a close watch on perf suite results after this change, to ensure we did not inject memory issues.
Reviewer: Glenn
QA: No (Keeping watch on Mustella, but cyclone looked good).

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as

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

--- frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as
+++ frameworks/projects/framework/src/mx/managers/layoutClasses/PriorityQueue.as
@@ -14,6 +14,8 @@

 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
+import flash.utils.Dictionary;
+
 import mx.core.IChildList;
 import mx.core.IRawChildrenContainer;
 import mx.managers.ILayoutManagerClient;
@@ -27,251 +29,333 @@
  */
 public class PriorityQueue
 {
-	include "../../core/Version.as";
-
-	//--------------------------------------------------------------------------
-	//
-	//  Constructor
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Constructor.
-	 */
-	public function PriorityQueue()
-	{
-		super();
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Variables
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private var arrayOfArrays:Array /* of Array */ = [];
-
-	/**
-	 *  @private
-	 *  The smallest occupied index in arrayOfArrays.
-	 */
-	private var minPriority:int = 0;
-
-	/**
-	 *  @private
-	 *  The largest occupied index in arrayOfArrays.
-	 */
-	private var maxPriority:int = -1;
-
-	//--------------------------------------------------------------------------
-	//
-	//  Methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	public function addObject(obj:Object, priority:int):void
-	{
-		if (!arrayOfArrays[priority])
-			arrayOfArrays[priority] = [];
-
-		arrayOfArrays[priority].push(obj);
-
-		if (maxPriority < minPriority)
-		{
-			minPriority = maxPriority = priority;
-		}
-		else
-		{
-			if (priority < minPriority)
-				minPriority = priority;
-			if (priority > maxPriority)
-				maxPriority = priority;
-		}
-	}
-
-	/**
-	 *  @private
-	 */
-	public function removeLargest():Object
-	{
-		var obj:Object = null;
-
-		if (minPriority <= maxPriority)
-		{
-			while (!arrayOfArrays[maxPriority] ||
-				   arrayOfArrays[maxPriority].length == 0)
-			{
-				maxPriority--;
-				if (maxPriority < minPriority)
-					return null;
-			}
-
-			obj = arrayOfArrays[maxPriority].shift();
-
-			while (!arrayOfArrays[maxPriority] ||
-				   arrayOfArrays[maxPriority].length == 0)
-			{
-				maxPriority--;
-				if (maxPriority < minPriority)
-					break;
-			}
-
-		}
-
-		return obj;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function removeLargestChild(client:ILayoutManagerClient ):Object
-	{
-		var obj:Object = null;
-
-		var max:int = maxPriority;
-		var min:int = client.nestLevel;
-
-		while (min <= max)
-		{
-			if (arrayOfArrays[max] &&
-				   arrayOfArrays[max].length > 0)
-			{
-				for (var i:int = 0; i < arrayOfArrays[max].length; i++)
-				{
-					if (contains(DisplayObject(client), arrayOfArrays[max][i]))
-					{
-						obj = arrayOfArrays[max][i];
-						arrayOfArrays[max].splice(i, 1);
-						return obj;
-					}
-				}
-				max--;
-			}
-			else
-			{
-				if (max == maxPriority)
-					maxPriority--;
-				max--;
-				if (max < min)
-					break;
-			}
-		}
-
-		return obj;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function removeSmallest():Object
-	{
-		var obj:Object = null;
-
-		if (minPriority <= maxPriority)
-		{
-			while (!arrayOfArrays[minPriority] ||
-				   arrayOfArrays[minPriority].length == 0)
-			{
-				minPriority++;
-				if (minPriority > maxPriority)
-					return null;
-			}
-
-			obj = arrayOfArrays[minPriority].shift();
-
-			while (!arrayOfArrays[minPriority] ||
-				   arrayOfArrays[minPriority].length == 0)
-			{
-				minPriority++;
-				if (minPriority > maxPriority)
-					break;
-			}
-		}
-
-		return obj;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function removeSmallestChild(client:ILayoutManagerClient ):Object
-	{
-		var obj:Object = null;
-
-		var min:int = client.nestLevel;
-
-		while (min <= maxPriority)
-		{
-			if (arrayOfArrays[min] &&
-				   arrayOfArrays[min].length > 0)
-			{
-				for (var i:int = 0; i < arrayOfArrays[min].length; i++)
-				{
-					if (contains(DisplayObject(client), arrayOfArrays[min][i]))
-					{
-						obj = arrayOfArrays[min][i];
-						arrayOfArrays[min].splice(i, 1);
-						return obj;
-					}
-				}
-				min++;
-			}
-			else
-			{
-				if (min == minPriority)
-					minPriority++;
-				min++;
-				if (min > maxPriority)
-					break;
-			}
-		}
-
-		return obj;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function removeAll():void
-	{
-		arrayOfArrays.splice(0);
-
-		minPriority = 0;
-		maxPriority = -1;
-	}
-
-	/**
-	 *  @private
-	 */
-	public function isEmpty():Boolean
-	{
-		return minPriority > maxPriority;
-	}
-
-	/**
-	 *  @private
-	 */
-	private function contains(parent:DisplayObject, child:DisplayObject):Boolean
-	{
-		if (parent is IRawChildrenContainer)
-		{
-			// trace("using view rawChildren");
-			var rawChildren:IChildList = IRawChildrenContainer(parent).rawChildren;
-			return rawChildren.contains(child);
-		}
-		else if (parent is DisplayObjectContainer)
-		{
-			return DisplayObjectContainer(parent).contains(child);
-		}
-
-		return parent == child;
-	}
+    include "../../core/Version.as";
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     */
+    public function PriorityQueue()
+    {
+        super();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private var arrayOfDictionaries:Array = [];
+
+    /**
+     *  @private
+     *  The smallest occupied index in arrayOfDictionaries.
+     */
+    private var minPriority:int = 0;
+
+    /**
+     *  @private
+     *  The largest occupied index in arrayOfDictionaries.
+     */
+    private var maxPriority:int = -1;
+
+    /**
+     *  @private
+     *  Used to keep track of change deltas.
+     */
+    public var generation:int = 0;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    public function addObject(obj:Object, priority:int):void
+    {
+        // If no hash exists for the specified priority, create one.
+        if (!arrayOfDictionaries[priority])
+        {
+            arrayOfDictionaries[priority] = new Object;
+            arrayOfDictionaries[priority].length = 0;
+            arrayOfDictionaries[priority].items = new Dictionary(false);
+        }
+
+        // If we don't already hold the obj in the specified hash, add it
+        // and update our item count.
+        if (arrayOfDictionaries[priority].items[obj] == null)
+        {
+            arrayOfDictionaries[priority].items[obj] = true;
+            arrayOfDictionaries[priority].length++;
+        }
+
+        // Update our min and max priorities.
+        if (maxPriority < minPriority)
+        {
+            minPriority = maxPriority = priority;
+        }
+        else
+        {
+            if (priority < minPriority)
+                minPriority = priority;
+            if (priority > maxPriority)
+                maxPriority = priority;
+        }
+
+        // Update our changelist id since we've added an item.
+        generation++;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeLargest():Object
+    {
+        var obj:Object = null;
+
+        if (minPriority <= maxPriority)
+        {
+            while (!arrayOfDictionaries[maxPriority] ||
+                   arrayOfDictionaries[maxPriority].length == 0)
+            {
+                maxPriority--;
+                if (maxPriority < minPriority)
+                    return null;
+            }
+
+            // Remove the item with largest priority from our priority queue.
+            // Must use a for loop here since we're removing a specific item
+            // from a 'Dictionary' (no means of directly indexing).
+            for (var key:Object in arrayOfDictionaries[maxPriority].items )
+            {
+                obj = key;
+                removeChild(ILayoutManagerClient(key),maxPriority);
+                break;
+            }
+
+            // Update maxPriority if applicable.
+            while (!arrayOfDictionaries[maxPriority] ||
+                   arrayOfDictionaries[maxPriority].length == 0)
+            {
+                maxPriority--;
+                if (maxPriority < minPriority)
+                    break;
+            }
+
+        }
+
+        return obj;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeLargestChild(client:ILayoutManagerClient ):Object
+    {
+        var max:int = maxPriority;
+        var min:int = client.nestLevel;
+
+        while (min <= max)
+        {
+            if (arrayOfDictionaries[max] && arrayOfDictionaries[max].length > 0)
+            {
+                if (max == client.nestLevel)
+                {
+                    // If the current level we're searching matches that of our
+                    // client, no need to search the entire list, just check to see
+                    // if the client exists in the queue (it would be the only item
+                    // at that nestLevel).
+                    if (arrayOfDictionaries[max].items[client])
+                    {
+                        removeChild(ILayoutManagerClient(client), max);
+                        return client;
+                    }
+                }
+                else
+                {
+                    for (var key:Object in arrayOfDictionaries[max].items )
+                    {
+                        if (contains(DisplayObject(client), DisplayObject(key)))
+                        {
+                            removeChild(ILayoutManagerClient(key), max);
+                            return key;
+                        }
+                    }
+                }
+
+                max--;
+            }
+            else
+            {
+                if (max == maxPriority)
+                    maxPriority--;
+                max--;
+                if (max < min)
+                    break;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeSmallest():Object
+    {
+        var obj:Object = null;
+
+        if (minPriority <= maxPriority)
+        {
+            while (!arrayOfDictionaries[minPriority] ||
+                   arrayOfDictionaries[minPriority].length == 0)
+            {
+                minPriority++;
+                if (minPriority > maxPriority)
+                    return null;
+            }
+
+            // Remove the item with smallest priority from our priority queue.
+            // Must use a for loop here since we're removing a specific item
+            // from a 'Dictionary' (no means of directly indexing).
+            for (var key:Object in arrayOfDictionaries[minPriority].items )
+            {
+                obj = key;
+                removeChild(ILayoutManagerClient(key),minPriority);
+                break;
+            }
+
+            // Update minPriority if applicable.
+            while (!arrayOfDictionaries[minPriority] ||
+                   arrayOfDictionaries[minPriority].length == 0)
+            {
+                minPriority++;
+                if (minPriority > maxPriority)
+                    break;
+            }
+        }
+
+        return obj;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeSmallestChild(client:ILayoutManagerClient ):Object
+    {
+        var min:int = client.nestLevel;
+
+        while (min <= maxPriority)
+        {
+            if (arrayOfDictionaries[min] &&  arrayOfDictionaries[min].length > 0)
+            {
+                if (min == client.nestLevel)
+                {
+                    // If the current level we're searching matches that of our
+                    // client, no need to search the entire list, just check to see
+                    // if the client exists in the queue (it would be the only item
+                    // at that nestLevel).
+                    if (arrayOfDictionaries[min].items[client])
+                    {
+                        removeChild(ILayoutManagerClient(client), min);
+                        return client;
+                    }
+                }
+                else
+                {
+                    for (var key:Object in arrayOfDictionaries[min].items)
+                    {
+                        if (contains(DisplayObject(client), DisplayObject(key)))
+                        {
+                            removeChild(ILayoutManagerClient(key), min);
+                            return key;
+                        }
+                    }
+                }
+
+                min++;
+            }
+            else
+            {
+                if (min == minPriority)
+                    minPriority++;
+                min++;
+                if (min > maxPriority)
+                    break;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeChild(client:ILayoutManagerClient, level:int=-1):Object
+    {
+        var priority:int = (level >= 0) ? level : client.nestLevel;
+        if (arrayOfDictionaries[priority] &&
+            arrayOfDictionaries[priority].items[client] != null)
+        {
+            delete arrayOfDictionaries[priority].items[client];
+            arrayOfDictionaries[priority].length--;
+
+            // Update our changelist id since we've removed an item.
+            generation++;
+
+            return client;
+        }
+        return null;
+    }
+
+    /**
+     *  @private
+     */
+    public function removeAll():void
+    {
+        arrayOfDictionaries.splice(0);
+        minPriority = 0;
+        maxPriority = -1;
+        generation += 1;
+    }
+
+    /**
+     *  @private
+     */
+    public function isEmpty():Boolean
+    {
+        return minPriority > maxPriority;
+    }
+
+    /**
+     *  @private
+     */
+    private function contains(parent:DisplayObject, child:DisplayObject):Boolean
+    {
+        if (parent is IRawChildrenContainer)
+        {
+            var rawChildren:IChildList = IRawChildrenContainer(parent).rawChildren;
+            return rawChildren.contains(child);
+        }
+        else if (parent is DisplayObjectContainer)
+        {
+            return DisplayObjectContainer(parent).contains(child);
+        }
+
+        return parent == child;
+    }

 }


avoiding excess ILinkableVariable toggle

--- WeaveUISpark/src/weave/menus/WeaveMenuItem.as
+++ WeaveUISpark/src/weave/menus/WeaveMenuItem.as
@@ -213,8 +213,11 @@
 			if (click is Function)
 				evalFunction(click as Function);

+			// If 'click' is set to the same ILinkableVariable as 'toggled',
+			// don't do anything here because Flex automatically calls "set toggled"
+			// which will set the session state of the ILinkableVariable.
 			var lv:ILinkableVariable = click as ILinkableVariable;
-			if (lv)
+			if (lv && lv != _toggled)
 				lv.setSessionState(!lv.getSessionState());
 		}
 	}


Might as well make our actionscript trim() null tolerant as well.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5454 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/util/StringUtil.as
+++ src/as/com/threerings/util/StringUtil.as
@@ -285,6 +285,10 @@
      */
     public static function trimBeginning (str :String) :String
     {
+        if (str == null) {
+            return null;
+        }
+
         var startIdx :int = 0;
         // this works because charAt() with an invalid index returns "", which is not whitespace
         while (isWhitespace(str.charAt(startIdx))) {
@@ -301,6 +305,10 @@
      */
     public static function trimEnd (str :String) :String
     {
+        if (str == null) {
+            return null;
+        }
+
         var endIdx :int = str.length;
         // this works because charAt() with an invalid index returns "", which is not whitespace
         while (isWhitespace(str.charAt(endIdx - 1))) {


abcdump: recognize SWF10 magic numbers, add option to dump abc files for each ABC section of a swf

--- utils/abcdump.as
+++ utils/abcdump.as
@@ -980,6 +980,8 @@
 			parseClassInfos()
 			parseScriptInfos()
 			parseMethodBodies()
+
+			if (extractAbc==true) { data.writeFile(nextAbcFname()); }
 		}

 		function readU32():int
@@ -1652,11 +1654,48 @@
 	        }
 	    }
     }
-
+
+	function help()
+	{
+		print('usage:  abcdump [-x] file...')
+		print('Displays the contents of an abc or swf file(s)')
+		print('  -a  writes out the abc contained within the swf')
+		System.exit(1)
+	}
+
+	function processArg(arg:String)
+	{
+		if (arg == '-a')
+			extractAbc = true;
+		else
+		{
+			print('Unknown option '+arg)
+			help()
+		}
+	}
+
+	function nextAbcFname():String
+	{
+		var s = currentFname
+		if (currentFcount>0)
+			s = s.concat(currentFcount);
+		currentFcount++
+		return s+'.abc'
+	}
+
 	// main
-
+	var extractAbc = false
+	var currentFname = ''
+	var currentFcount = 0
 	for each (var file in System.argv)
 	{
+		if (file.indexOf('-')>=0)
+		{
+			processArg(file)
+			continue
+		}
+
+		currentFname = file.split('.')[0]
 		var data:ByteArray = ByteArray.readFile(file)
 		data.endian = "littleEndian"
 		var version:uint = data.readUnsignedInt()
@@ -1667,6 +1706,7 @@
 			var abc:Abc = new Abc(data)
 			abc.dump()
 			break
+		case 67|87<<8|83<<16|10<<24: // SWC10
 		case 67|87<<8|83<<16|9<<24: // SWC9
 		case 67|87<<8|83<<16|8<<24: // SWC8
 		case 67|87<<8|83<<16|7<<24: // SWC7
@@ -1681,6 +1721,7 @@
 			udata.position = 0
 		    /*var swf:Swf =*/ new Swf(udata)
 			break
+		case 70|87<<8|83<<16|10<<24: // SWC10
 		case 70|87<<8|83<<16|9<<24: // SWC9
 		case 70|87<<8|83<<16|8<<24: // SWC8
 		case 70|87<<8|83<<16|7<<24: // SWC7
@@ -1695,5 +1736,8 @@
 			break
 		}
 	}
+
+	if (System.argv<2)
+		help();
 }


Fixed scrollbar

Fixed scrollbar

--- src/UI/Scrollbar.as
+++ src/UI/Scrollbar.as
@@ -67,7 +67,7 @@
 		protected function checkClick():void {
 			var adjMouse:FlxPoint = getAdjMouse();
 			var barMoused:Boolean = ((adjMouse.y >= rail.y && adjMouse.y <= rail.y + rail.height) &&
-									 (adjMouse.x >= slider.x && adjMouse.x <= slider.x + slider.height) &&
+									 (adjMouse.x >= slider.x && adjMouse.x <= slider.x + slider.width) &&
 									 (!U.buttonManager || !U.buttonManager.moused));
 			if (barMoused && U.buttonManager)
 				U.buttonManager.moused = true


Update AirTestFairy.as

Update AirTestFairy.as

--- flex/AirTestFairy/src/com/testfairy/AirTestFairy.as
+++ flex/AirTestFairy/src/com/testfairy/AirTestFairy.as
@@ -10,66 +10,55 @@
 			return Capabilities.manufacturer.indexOf("iOS") > -1;
 		}

-		public static function begin():void
+		public static function begin(appToken:String):void
 		{
-			traceLog("TESTFAIRY LOG");
-
-			call("begin");
+			if (value) {
+				call("begin", appToken);
+			}
 		}

 		public static function pushFeedbackController():void
 		{
-			traceLog("TESTFAIRY LOG");
-
 			call("pushFeedbackController");
 		}

 		public static function setCorrelationId(value:String):void
 		{
-			traceLog("TESTFAIRY LOG");
-
-			if (value)
-			{
+			if (value) {
 				call("setCorrelationId", value);
 			}
 		}

 		public static function getSessionUrl():String
 		{
-			traceLog("TESTFAIRY LOG");
-
 			return call("getSessionUrl");
 		}

 		public static function pause():void
 		{
-			traceLog("TESTFAIRY LOG");
-
 			call("pause");
 		}

 		public static function resume():void
 		{
-			traceLog("TESTFAIRY LOG");
-
 			call("resume");
 		}

 		public static function takeScreenshot():void
 		{
-			traceLog("TESTFAIRY LOG");
-
 			call("takeScreenshot");
 		}

 		public static function log(value:String):void
 		{
-			traceLog("TESTFAIRY LOG");
-
-			if (value)
-			{
+			if (value) {
 				call("log", value);
 			}
+		}
+
+		public static function getVersion():String
+		{
+			return call("getVersion");
 		}

 		private static const EXTENSION_ID : String = "com.testfairy";
@@ -87,7 +76,6 @@

 		private static function traceLog(msg:String):void
 		{
-			trace("Adam" + msg);
 		}
 	}
-}+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 10814
Author:   cframpto@adobe.com
Date:     2009-10-02T15:45:31.406572Z

Log Message:
-----------
Added selectionActivePosition and selectionAnchorPosition to ITextInput interface.  Renamed params of selectRange to anchorPosition and activePosition from anchorIndex and activeIndex to be consistent.

Make sure the SwatchPanel gets the textInputClass style from either itself or passed down from its parent ColorPicker.as

When changing the text in the SwatchPanel, need to save the selection and restore it after setting the text since TLF does not preserve the selection.

In TLFText.css added missing textFieldClass style to ColorPicker and ComboBox.  Also added style for s|TLFTextInput skinClass to ensure the spark TextInput skin is pulled in if this theme is used (spark default.css may not be in the path).

QE notes: need to compile TLFText with -theme+="TLFText.css" now rather than theme="TLFText.css"
Doc notes:
Bugs: SDK-22935, SDK-23548
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ITextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/TLFText.css</path>

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

--- frameworks/projects/mx/src/mx/controls/TextInput.as
+++ frameworks/projects/mx/src/mx/controls/TextInput.as
@@ -206,6 +206,13 @@

 [Alternative(replacement="spark.components.TextInput", since="4.0")]

+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="selectionActivePosition", kind="method")]
+[Exclude(name="selectionAnchorPosition", kind="method")]
+
 /**
  *  The TextInput control is a single-line text field
  *  that is optionally editable.
@@ -2297,6 +2304,37 @@
     //--------------------------------------------------------------------------

     /**
+     *  For the ITextInput interface; the same as selectionEndIndex.
+     *
+     *  @see mx.controls.TextInput#selectionEndIndex
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get selectionActivePosition():int
+    {
+        return selectionEndIndex;
+    }
+
+
+    /**
+     *  For the ITextInput interface; the same as selectionBeginIndex.
+     *
+     *  @see mx.controls.TextInput#selectionBeginIndex
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get selectionAnchorPosition():int
+    {
+        return selectionBeginIndex;
+    }
+
+    /**
      *  Used to determine if the control's border and background are
      *  visible.
      *


Update Output font to "_sans".

Update Output font to "_sans".

--- src/net/manaca/logging/publishers/Output.as
+++ src/net/manaca/logging/publishers/Output.as
@@ -76,7 +76,7 @@

     //default text format
     private const defaultTextFormat:TextFormat =
-        new TextFormat("Verdana,Tahoma,_sans");
+        new TextFormat("_sans");

     //search text field
     private var searchLabel:TextField;


Added a toString().

Added a toString().

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@4160 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/whirled/spot/data/Portal.as
+++ src/as/com/threerings/whirled/spot/data/Portal.as
@@ -129,5 +129,11 @@
     {
         return portalId;
     }
+
+    public function toString () :String
+    {
+        return "Portal[id=" + portalId + ", destScene=" + targetSceneId +
+            ", loc=" + loc + "].";
+    }
 }
 }


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

--- frameworks/projects/airframework/src/mx/skins/halo/ApplicationTitleBarBackgroundSkin.as
+++ frameworks/projects/airframework/src/mx/skins/halo/ApplicationTitleBarBackgroundSkin.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.skins.halo
 {


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

--- frameworks/projects/framework/src/mx/collections/IViewCursor.as
+++ frameworks/projects/framework/src/mx/collections/IViewCursor.as
@@ -18,6 +18,11 @@
  *  Dispatched whenever the cursor position is updated.
  *
  *  @eventType mx.events.FlexEvent.CURSOR_UPDATE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 [Event(name="cursorUpdate", type="mx.events.FlexEvent")]

@@ -29,6 +34,11 @@
  *  createCursor() method) the value of the
  *  current property should be the first
  *  item in the view, unless the view is empty.
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
  */
 public interface IViewCursor extends IEventDispatcher
 {
@@ -49,6 +59,11 @@
      *  this property is true .
      *  If the ICollectionView is empty (length == 0),
      *  this property is true.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function get afterLast():Boolean;

@@ -63,6 +78,11 @@
      *  this property is true.
      *  If the ICollectionView is empty (length == 0),
      *  this property is true.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function get beforeFirst():Boolean;

@@ -81,6 +101,11 @@
      *
      *  @see #current
      *  @see #seek()
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function get bookmark():CursorBookmark;

@@ -102,6 +127,11 @@
      *  @see #seek()
      *  @see #beforeFirst
      *  @see #afterLast
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function get current():Object;

@@ -111,6 +141,11 @@

     /**
      *  A reference to the ICollectionView with which this cursor is associated.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function get view():ICollectionView;

@@ -155,6 +190,11 @@
      *  @see #findFirst()
      *  @see #findLast()
      *  @see mx.collections.errors.ItemPendingError
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function findAny(values:Object):Boolean;

@@ -191,6 +231,11 @@
      *  @see #findAny()
      *  @see #findLast()
      *  @see mx.collections.errors.ItemPendingError
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function findFirst(values:Object):Boolean;

@@ -227,6 +272,11 @@
      *  @see #findAny()
      *  @see #findFirst()
      *  @see mx.collections.errors.ItemPendingError
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function findLast(values:Object):Boolean;

@@ -238,6 +288,11 @@
      *  an error is thrown.
      *
      *  @param item The item to insert before the cursor's current position.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function insert(item:Object):void;

@@ -272,6 +327,11 @@
      *      cursor.moveNext();
      *  }
      *

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function moveNext():Boolean;

@@ -307,6 +367,11 @@
      *  @see #current
      *  @see #moveNext()
      *  @see mx.collections.errors.ItemPendingError
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function movePrevious():Boolean;

@@ -326,6 +391,11 @@
      *  @return The item that was removed.
      *
      *  @see mx.collections.errors.ItemPendingError
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     function remove():Object;

@@ -373,6 +443,11 @@
      *  to iterate it.
      *
      *  @see mx.collections.errors.ItemPendingError
+    *
+    *  @langversion 3.0
+    *  @playerversion Flash 9
+    *  @playerversion AIR 1.1
+    *  @productversion Flex 3
     */
     function seek(bookmark:CursorBookmark, offset:int = 0, prefetch:int = 0):void;
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 10000
Author:   rfrishbe@adobe.com
Date:     2009-09-03T19:58:06.612834Z

Log Message:
-----------
Fixing up RichText for use in the FXG compiler case.  This was a fallout from yesterday's checkin moving around spark text components and re-base-classing them.  UIComponents need a parent and a nestLevel for validateXXX() calls to work where as graphic element's don't.

QE notes:-
Doc notes:-
Bugs: SDK-22981
Reviewer: Glenn, Corey
Tests run: checkintests, test case with bug
Is noteworthy for integration: Yes

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/core/SpriteVisualElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/fxg/FlexFXG2SWFTranscoder.java</path>

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

--- frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
+++ frameworks/projects/spark/src/spark/core/SpriteVisualElement.as
@@ -12,6 +12,7 @@
 package spark.core
 {

+import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
 import flash.events.Event;
 import flash.events.IEventDispatcher;
@@ -27,6 +28,7 @@
 import mx.core.FlexSprite;
 import mx.core.IID;
 import mx.core.IInvalidating;
+import mx.core.IUIComponent;
 import mx.core.IVisualElement;
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
@@ -34,6 +36,7 @@
 import mx.filters.IBitmapFilter;
 import mx.geom.Transform;
 import mx.geom.TransformOffsets;
+import mx.managers.ILayoutManagerClient;
 import mx.utils.MatrixUtil;

 import spark.components.ResizeMode;
@@ -1445,6 +1448,71 @@
 	{
 		return super.transform;
 	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function addChild(child:DisplayObject):DisplayObject
+    {
+        // Do anything that needs to be done before the child is added.
+        // In the case of SVE..we just need to deal with text UIComponents
+        // and setting them up because this is a "static" object
+        addingChild(child);
+
+        super.addChild(child);
+
+        childAdded(child);
+
+        return child;
+    }
+
+    /**
+     *  @private
+     */
+    override public function addChildAt(child:DisplayObject,
+                                        index:int):DisplayObject
+    {
+        addingChild(child);
+
+        super.addChildAt(child, index);
+
+        childAdded(child);
+
+        return child;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function addingChild(child:DisplayObject):void
+    {
+        // for SVE, we just need to set up the parent and the nestLevel
+        if (child is IUIComponent)
+            IUIComponent(child).parentChanged(this);
+
+        // Set the nestLevel to "2" since we don't really have a
+        // concept of nestLevel for SVE
+        if (child is ILayoutManagerClient)
+            ILayoutManagerClient(child).nestLevel = 2;
+    }
+
+    /**
+     *  @private
+     */
+    mx_internal function childAdded(child:DisplayObject):void
+    {
+        // for SVE, we just need call initialize()
+        if (child is IUIComponent)
+        {
+            IUIComponent(child).initialize();
+        }
+    }

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


updated formatting

updated formatting

--- dorkbots/dorkbots_ui/TruncateTextField.as
+++ dorkbots/dorkbots_ui/TruncateTextField.as
@@ -101,8 +101,7 @@
 			if (!ellipses) limit += 3;
 			if (!moreLink) limit += 6;

-			if(limit <= 0)
-				return "";
+			if(limit <= 0) return "";

 			var original:String = value;

@@ -114,28 +113,41 @@
 			var limitLength:int = value.length - 1;
 			var closeTag:Boolean = false;

-			for(var i:int = 0; i < value.length; i++) {
+			for(var i:int = 0; i < value.length; i++)
+			{
 				var c:String = value.charAt(i);
-				if(isTag) {
-					if(c == '>') {
+				if(isTag)
+				{
+					if(c == '>')
+					{
 						isTag = false;
-						if(closeTag || i == limitLength) {
+						if(closeTag || i == limitLength)
+						{
 							position = i;
 							break;
 						}
 						continue;
-					} else {
+					}
+					else
+					{
 						continue;
 					}
-				} else {
-					if(c == '<') {
+				}
+				else
+				{
+					if(c == '<')
+					{
 						isTag = true;
-					} else {
+					}
+					else
+					{
 						count++;
-						if(i == limitLength || (count == limit)) {
+						if(i == limitLength || (count == limit))
+						{
 							if(((i+1) < limitLength) && ((i+2) < limitLength))
 							{
-								if(value.charAt(i+1) == '<' && value.charAt(i+2) == '/') {
+								if(value.charAt(i+1) == '<' && value.charAt(i+2) == '/')
+								{
 									closeTag = true;
 									continue;
 								}
@@ -154,21 +166,23 @@
 			var nextChar:String = (length >= value.length) ? ' ' : value.charAt(length);

 			if(last != ' ' && last != '>' && nextChar != ' ' && nextChar != '<')
+			{
 				result = result.substring(0, result.lastIndexOf(' ') + 1);
+			}
 			var lastStartTag:int = result.lastIndexOf('<');

-			if(lastStartTag != -1) {
+			if(lastStartTag != -1)
+			{
 				var ch:String = result.charAt(lastStartTag + 1);
-				if(ch != '/') {
+				if(ch != '/')
+				{
 					result = result.substring(0, lastStartTag);
 				}
 			}

-			if(original.length == result.length)
-				return original;
-
-			if(result.length == 0)
-				return result;
+			if(original.length == result.length) return original;
+
+			if(result.length == 0) return result;

 			// Remove any spaces and periods at the end
 			while(result.charAt(result.length - 1) == " " || result.charAt(result.length - 1) == ".")
@@ -180,8 +194,7 @@

 			var pattern:RegExp = new RegExp("(.*?)(\\s*\.\.\.\\s*)([\</[a-z]*?\>\\s*$]+)", "i");

-			if(result.search(pattern) == -1 && ellipses)
-				result += "...";
+			if(result.search(pattern) == -1 && ellipses) result += "...";

 			if (moreLink)
 			{


As ParticleEmitter is now considerably more lightweight with its attributes, NinjaSnowWar no longer needs to use a remote event to create synced particle effects; instead they can just be replicated through the scene sync.

--- Bin/Data/Scripts/NinjaSnowWar.as
+++ Bin/Data/Scripts/NinjaSnowWar.as
@@ -197,7 +197,6 @@
         SubscribeToEvent("UpdateScore", "HandleUpdateScore");
         SubscribeToEvent("UpdateHiscores", "HandleUpdateHiscores");
         SubscribeToEvent("NetworkUpdateSent", "HandleNetworkUpdateSent");
-        SubscribeToEvent("ParticleEffect", "HandleParticleEffect");
     }
 }

@@ -644,14 +643,6 @@
         network.serverConnection.controls.Set(CTRL_ALL, false);
 }

-void HandleParticleEffect(StringHash eventType, VariantMap& eventData)
-{
-    Vector3 position = eventData["Position"].GetVector3();
-    String effectName = eventData["EffectName"].GetString();
-    float duration = eventData["Duration"].GetFloat();
-    SpawnParticleEffect(position, effectName, duration, LOCAL);
-}
-
 int FindPlayerIndex(uint nodeID)
 {
     for (uint i = 0; i < players.length; ++i)
@@ -759,23 +750,15 @@

 Node@ SpawnParticleEffect(const Vector3&in position, const String&in effectName, float duration, CreateMode mode = REPLICATED)
 {
-    if (runServer && mode == REPLICATED)
-    {
-        VariantMap eventData;
-        eventData["Position"] = position;
-        eventData["EffectName"] = effectName;
-        eventData["Duration"] = duration;
-        network.BroadcastRemoteEvent(gameScene, "ParticleEffect", false, eventData);
-    }
-
-    Node@ newNode = scene.CreateChild("Effect", LOCAL);
+    Node@ newNode = scene.CreateChild("Effect", mode);
     newNode.position = position;

     // Create the particle emitter
     ParticleEmitter@ emitter = newNode.CreateComponent("ParticleEmitter");
     emitter.effect = cache.GetResource("ParticleEffect", effectName);

-    // Create a GameObject for managing the effect lifetime
+    // Create a GameObject for managing the effect lifetime. This is always local, so for server-controlled effects it
+    // exists only on the server
     GameObject@ object = cast<GameObject>(newNode.CreateScriptObject(scriptFile, "GameObject", LOCAL));
     object.duration = duration;


Transferred from the Adobe Open Source Subversion Repository

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

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

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

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

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

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

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

--- frameworks/projects/automation/src/mx/automation/delegates/controls/TreeAutomationImpl.as
+++ frameworks/projects/automation/src/mx/automation/delegates/controls/TreeAutomationImpl.as
@@ -0,0 +1,380 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2009 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.automation.delegates.controls
+{
+
+	import flash.display.DisplayObject;
+	import flash.events.Event;
+	import flash.events.KeyboardEvent;
+	import flash.events.MouseEvent;
+	import flash.ui.Keyboard;
+	import flash.utils.getTimer;
+
+	import mx.automation.Automation;
+	import mx.automation.IAutomationManager;
+	import mx.automation.IAutomationObject;
+	import mx.automation.IAutomationObjectHelper;
+	import mx.automation.delegates.DragManagerAutomationImpl;
+	import mx.automation.events.AutomationDragEvent;
+	import mx.automation.events.ListItemSelectEvent;
+	import mx.automation.tabularData.TreeTabularData;
+	import mx.collections.CursorBookmark;
+	import mx.collections.ICollectionView;
+	import mx.collections.IViewCursor;
+	import mx.controls.Tree;
+	import mx.controls.listClasses.IDropInListItemRenderer;
+	import mx.controls.listClasses.IListItemRenderer;
+	import mx.controls.listClasses.ListBaseContentHolder;
+	import mx.controls.treeClasses.TreeItemRenderer;
+	import mx.core.IDataRenderer;
+	import mx.core.UIComponentGlobals;
+	import mx.core.mx_internal;
+	import mx.events.DragEvent;
+	import mx.events.TreeEvent;
+
+	use namespace mx_internal;
+
+	[Mixin]
+
+	[ResourceBundle("controls")]
+
+	/**
+	 *
+	 *  Defines methods and properties required to perform instrumentation for the
+	 *  Tree control.
+	 *
+	 *  @see mx.controls.Tree
+	 *
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public class TreeAutomationImpl extends ListAutomationImpl
+	{
+		include "../../../core/Version.as";
+
+		//--------------------------------------------------------------------------
+		//
+		//  Class methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Registers the delegate class for a component class with automation manager.
+		 *
+		 *  @param root The SystemManger of the application.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public static function init(root:DisplayObject):void
+		{
+			Automation.registerDelegateClass(Tree, TreeAutomationImpl);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Constructor
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  Constructor.
+		 *
+		 *  @param obj Tree object to be automated.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		public function TreeAutomationImpl(obj:Tree)
+		{
+			super(obj);
+
+			obj.addEventListener(TreeEvent.ITEM_OPEN, recordAutomatableEvent, false, 0, true);
+			obj.addEventListener(TreeEvent.ITEM_CLOSE, recordAutomatableEvent, false, 0, true);
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Properties
+		//
+		//--------------------------------------------------------------------------
+
+		//----------------------------------
+		//  tree
+		//----------------------------------
+
+		/**
+		 *  @private
+		 *  storage for the owner component
+		 */
+		protected function get tree():Tree
+		{
+			return uiComponent as Tree;
+		}
+
+		//--------------------------------------------------------------------------
+		//
+		//  Overridden methods
+		//
+		//--------------------------------------------------------------------------
+
+		/**
+		 *  @private
+		 */
+		override public function getItemAutomationValue(delegate:IAutomationObject):String
+		{
+			var result:Array = [];
+
+			var renderer:IListItemRenderer = delegate as IListItemRenderer;
+			var curItem:Object = renderer.data;
+			// while (curItem.getParent())   //
+			while (curItem)
+			{
+				renderer = tree.getListVisibleData()[tree.getItemUID(curItem)];
+				if (!renderer)
+				{
+					var contentHolder:ListBaseContentHolder = tree.getListContentHolder();
+					renderer = IListItemRenderer(contentHolder.getChildByName("hiddenItem"));
+					if (!renderer)
+					{
+						renderer = tree.itemRenderer.newInstance();
+						//trace("[Tree] created new item");
+						renderer.name = "hiddenItem";
+						renderer.visible = false;
+						renderer.styleName = contentHolder;
+						contentHolder.addChild(DisplayObject(renderer));
+					}
+					var uid:String = tree.getItemUID(curItem);
+					if (renderer is IDropInListItemRenderer)
+						IDropInListItemRenderer(renderer).listData =
+							tree.callMakeListData(curItem, uid, 0);
+					renderer.data = curItem;
+					UIComponentGlobals.layoutManager.validateClient(renderer, true);
+				}
+
+				if(renderer is IAutomationObject)
+					result.unshift(IAutomationObject(renderer).automationValue);
+
+				curItem = tree.getParentItem(curItem);
+			}
+
+			return result.join(">");
+		}
+
+		/**
+		 *  @private
+		 *  Replays NODE_OPEN, NODE_CLOSE, and CHANGE events. Replays NODE_OPEN /
+		 *  NODE_CLOSE by replaying the right/left arrow key on the item, if input
+		 *  type was keyboard, or delegating to the item renderer's replayAutomatableEvent
+		 *  otherwise. Replays CHANGE by clicking on the item.
+		 *
+		 *  TODOtesting make sure item renderer components have correct IDs
+		 *  TODOtesting clicking on a item's disclosure currently dispatches three CHANGEs and a NODE_OPEN. wtf?
+		 */
+		override public function replayAutomatableEvent(event:Event):Boolean
+		{
+			var completeTime:Number;
+			var help:IAutomationObjectHelper = Automation.automationObjectHelper;
+			if (event is TreeEvent)
+			{
+				var t:TreeEvent = TreeEvent(event);
+				var renderer:IListItemRenderer = t.itemRenderer;
+				var open:Boolean = tree.isItemOpen(renderer.data);
+
+				if ((t.type == TreeEvent.ITEM_OPEN && open) ||
+					(t.type == TreeEvent.ITEM_CLOSE && !open))
+					return false;
+
+				// we wait for the openDuration
+				completeTime = getTimer() + tree.getStyle("openDuration");
+
+
+				help.addSynchronization(function():Boolean
+				{
+					//we wait if the tree is opening
+					// this is required because tree increases the tween duration based
+					// on the number of items to open
+					return (!tree.isOpening && getTimer() >= completeTime);
+				});
+
+				if (t.triggerEvent is KeyboardEvent)
+				{
+					// if its an open and we're closed, or a close and we're open
+					tree.getFocus();
+
+					return help.replayKeyDownKeyUp(uiComponent,
+						(t.type == TreeEvent.ITEM_OPEN
+							? Keyboard.RIGHT
+							: Keyboard.LEFT));
+				}
+				else if (t.triggerEvent is MouseEvent)
+				{
+					if (renderer is TreeItemRenderer)
+						return help.replayClick(TreeItemRenderer(renderer).getDisclosureIcon());
+
+					if (renderer is IAutomationObject)
+						return IAutomationObject(renderer).replayAutomatableEvent(event);
+					else
+						throw new Error();
+				}
+				else
+				{
+					var message:String = resourceManager.getString(
+						"controls", "unknownInput", [t.triggerEvent.type]);
+					throw new Error(message);
+				}
+			}
+			else if (event is ListItemSelectEvent)
+			{
+				completeTime = getTimer() + tree.getStyle("openDuration");
+				help.addSynchronization(function():Boolean
+				{
+					//we wait if the tree is opening
+					// this is required because tree increases the tween duration based
+					// on the number of items to open
+					return (!tree.isOpening && getTimer() >= completeTime);
+				});
+			}
+			else if(event is AutomationDragEvent && event.type == AutomationDragEvent.DRAG_DROP)
+			{
+				var dragEvent:AutomationDragEvent = AutomationDragEvent(event);
+				if(dragEvent.dropParent && !dragEvent.draggedItem)
+				{
+					var mouseEvent:MouseEvent = null;
+
+					var index:int = tree.itemRendererToIndex(dragEvent.dropParent as IListItemRenderer) - tree.verticalScrollPosition;
+
+					var view:ICollectionView = tree.getChildren(IDataRenderer(dragEvent.dropParent).data, tree.dataProvider);
+
+					var targetItem:IListItemRenderer = tree.rendererArray[index+view.length+1][0];
+					var localX:Number = targetItem.width/2 ;
+					var localY:Number = tree.rowHeight/4;
+					dragEvent.localX = localX;
+					dragEvent.localY = localY;
+
+					DragManagerAutomationImpl.replayDragDrop(targetItem,tree as IAutomationObject,dragEvent,true);
+
+					/*
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_MOVE, true, false,
+					localX, localY, InteractiveObject(targetItem),
+					dragEvent.ctrlKey, dragEvent.altKey, dragEvent.shiftKey,
+					dragEvent.buttonDown);
+					mouseEvent.buttonDown = true;
+					help.replayMouseEvent(targetItem, mouseEvent);
+
+					mouseEvent = new MouseEvent(MouseEvent.MOUSE_UP, true, false,
+					localX, localY, InteractiveObject(targetItem),
+					dragEvent.ctrlKey, dragEvent.altKey, dragEvent.shiftKey,
+					dragEvent.buttonDown);
+					DragManager.dragProxy.action = dragEvent.action;
+					help.replayMouseEvent(targetItem, mouseEvent);
+					help.addSynchronization(function():Boolean
+					{
+					return !DragManager.isDragging;
+					});
+					*/
+
+					return true;
+				}
+			}
+
+			return super.replayAutomatableEvent(event);
+		}
+
+		/**
+		 *  A matrix of the automationValues of each item in the grid. The return value
+		 *  is an array of rows, each of which is an array of item renderers (row-major).
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion Flex 3
+		 */
+		override public function get automationTabularData():Object
+		{
+			return new TreeTabularData(tree);
+		}
+
+		/**
+		 *  @private
+		 */
+		override protected function dragDropHandler(event:DragEvent):void
+		{
+			if (dragScrollEvent)
+			{
+				recordAutomatableEvent(dragScrollEvent);
+				dragScrollEvent=null;
+			}
+
+			var index:int = listBase.calculateDropIndex(event);
+
+			var targetTree:Tree = Tree(event.target);
+			var am:IAutomationManager = Automation.automationManager;
+			index = targetTree._dropData.index;
+
+			var drag:AutomationDragEvent = new AutomationDragEvent(event.type);
+			var parent:IListItemRenderer = tree.itemToItemRenderer(targetTree._dropData.parent);
+
+			if (targetTree._dropData.parent && !parent)
+			{
+				//try to create a itemRenderer for this
+				parent = tree.itemRenderer.newInstance();
+				tree.setupRendererFromData(parent, targetTree._dropData.parent);
+				drag.dropParent = parent as IAutomationObject;
+				parent.owner = tree;
+			}
+
+			var i:int = 0;
+			var view:ICollectionView ;
+			var listItems:Array = tree.rendererArray;
+			if (parent)
+			{
+				drag.dropParent = parent as IAutomationObject;
+				view = tree.getChildren(targetTree._dropData.parent, tree.dataProvider);
+				if (index < view.length)
+					drag.draggedItem = tree.itemToItemRenderer(view[index]) as IAutomationObject;
+			}
+			else
+			{
+				var cursor:IViewCursor = tree.dataProvider.createCursor();
+				cursor.seek(CursorBookmark.FIRST, index);
+				drag.draggedItem = tree.itemToItemRenderer(cursor.current) as IAutomationObject;
+			}
+
+			drag.action = event.action;
+			preventDragDropRecording = false;
+			am.recordAutomatableEvent(uiAutomationObject, drag);
+			preventDragDropRecording = true;
+		}
+
+		/**
+		 *  @private
+		 */
+		override public function getItemsCount():int
+		{
+			if (tree.dataProvider)
+				return tree.collectionLength;
+
+			return 0;
+		}
+
+	}
+
+
+}


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

--- frameworks/projects/spark/src/spark/components/calendarClasses/DateSelectorDisplayMode.as
+++ frameworks/projects/spark/src/spark/components/calendarClasses/DateSelectorDisplayMode.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2011 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.calendarClasses
 {
 /**


Provide access to the send button.

Provide access to the send button.

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

--- src/as/com/threerings/flex/ChatControl.as
+++ src/as/com/threerings/flex/ChatControl.as
@@ -78,6 +78,14 @@
     public function get chatInput () :ChatInput
     {
         return _txt;
+    }
+
+    /**
+     * Provides access to the send button.
+     */
+    public function get sendButton () :CommandButton
+    {
+        return _but;
     }

     /**


Added version number const

Added version number const

--- src/org/mangui/hls/HLS.as
+++ src/org/mangui/hls/HLS.as
@@ -73,6 +73,9 @@

     /** Class that manages the streaming process. **/
     public class HLS extends EventDispatcher {
+
+		static public const VERSION:String = "0.4.4.20.42";
+
         private var _levelLoader : LevelLoader;
         private var _altAudioLevelLoader : AltAudioLevelLoader;
         private var _audioTrackController : AudioTrackController;


OPEN - issue REPRISE-69: Display freezing sometimes fails to work
http://j.fork.de:8080/browse/REPRISE-69

	- change: Added debug information

git-svn-id: e38e7cdd6ace00d8230583a2d3b43e9a55f5c011@590 bc4816be-ef27-423a-9c4d-fc420be121a2

--- src/reprise/ui/UIComponent.as
+++ src/reprise/ui/UIComponent.as
@@ -2539,7 +2539,19 @@
 				bounds = new Rectangle(m_positionOffset.x, m_positionOffset.y,
 					m_borderBoxWidth, m_borderBoxHeight);
 			}
-			m_frozenContent = new BitmapData(bounds.width, bounds.height, true, 0x0);
+			try
+			{
+				m_frozenContent = new BitmapData(bounds.width, bounds.height, true, 0x0);
+			}
+			catch(error : Error)
+			{
+				log('f aha, got the display freezing bug! More information:\nbounds: ' + bounds,
+					'\n!m_currentStyles.overflow || m_currentStyles.overflow == "visible": ' +
+					(!m_currentStyles.overflow || m_currentStyles.overflow == 'visible'));
+				log("m_borderBoxWidth: " + (m_borderBoxWidth));
+				log("m_borderBoxHeight: " + (m_borderBoxHeight));
+				throw(error);
+			}
 			m_contentDisplay.x -= bounds.left;
 			m_contentDisplay.y -= bounds.top;
 			m_frozenContent.draw(this, null, null, null,