<commit_before>package mx.components.baseClasses
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.utils.Dictionary;

import mx.events.FlexEvent;
import mx.events.ItemExistenceChangedEvent;
import mx.graphics.Graphic;

import mx.graphics.MaskType;
import mx.utils.MatrixUtil;
import mx.graphics.graphicsClasses.GraphicElement;
import mx.graphics.IGraphicElement;
import mx.layout.ILayoutItem;
import mx.core.IViewport;
import mx.core.ScrollUnit;
import mx.layout.LayoutBase;
import mx.layout.BasicLayout;
import mx.layout.LayoutItemFactory;

import mx.collections.ICollectionView;
import mx.collections.IList;
import mx.collections.ListCollectionView;
import mx.components.ResizeMode;
import mx.controls.Label;
import mx.core.IFactory;
import mx.core.mx_internal;
import mx.core.UIComponent;
import mx.events.CollectionEvent;
import mx.events.PropertyChangeEvent;
import mx.events.PropertyChangeEventKind;

use namespace mx_internal;

//--------------------------------------
//  Styles
//--------------------------------------

include "../../styles/metadata/BasicContainerFormatTextStyles.as"
include "../../styles/metadata/AdvancedContainerFormatTextStyles.as"
include "../../styles/metadata/BasicParagraphFormatTextStyles.as"
include "../../styles/metadata/AdvancedParagraphFormatTextStyles.as"
include "../../styles/metadata/BasicCharacterFormatTextStyles.as"
include "../../styles/metadata/AdvancedCharacterFormatTextStyles.as"
include "../../styles/metadata/SelectionFormatTextStyles.as"

[Exclude(name="enabled", kind="property")] 

/**
 *  The GroupBase class defines the base class for components that display visual elements.
 *  A group component does not control the layout of the visual items that it contains. 
 *  Instead, the layout is handled by a separate layout component.
 *
 *  @see mx.layout.LayoutBase
 *  @see mx.components.ResizeMode
 */
public class GroupBase extends UIComponent implements IViewport
{
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
    
    /**
     * Constructor.
     */
     public function GroupBase()
    {
        super();
        tabChildren = true;
        
        _layout = new BasicLayout();
        _layout.target = this;  
    }
        
    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
        
    //----------------------------------
    //  layout
    //----------------------------------    
        
    private var _layout:LayoutBase;  // initialized in the ctor
    private var _layoutProperties:Object = null;
    
    /**
     *  The layout object for this container.  
     *  This object determines how the visual elements are laid out in the container.
     */
    public function get layout():LayoutBase
    {
        return _layout;
    }
        
    /**
     *  Three properties are delegated to the layout: clipContent,
     *  verticalScrollPosition, horizontalScrollPosition.
     *  If the layout is reset, we copy the properties from the old
     *  layout to the new one.   If the new layout is null, then we
     *  temporarily store the delegated properties in _layoutProperties.
     *  
     *  @private
     */
    public function set layout(value:LayoutBase):void
    {
        if (_layout == value)
            return;

        if (value)
        {
            value.clipContent = clipContent;
            value.verticalScrollPosition = verticalScrollPosition;
            value.horizontalScrollPosition = horizontalScrollPosition;
            _layoutProperties = null;
        }
        else 
        {
            _layoutProperties = {
                verticalScrollPosition: _layout.verticalScrollPosition,
                horizontalScrollPosition: _layout.horizontalScrollPosition,
                clipContent: _layout.clipContent 
            };
        }

        if (_layout)
            _layout.target = null;
        _layout = value; 
        if (_layout)
            _layout.target = this;

        invalidateSize();
        invalidateDisplayList();
    }
    
    //----------------------------------
    //  horizontalScrollPosition
    //----------------------------------
        
    [Bindable]

    /**
     *  @copy mx.core.IViewport#horizontalScrollPosition
     */
    public function get horizontalScrollPosition():Number 
    {
        return (_layout) 
            ? _layout.horizontalScrollPosition 
            : _layoutProperties.horizontalScrollPosition;
    }

    /**
     *  @private
     */
    public function set horizontalScrollPosition(value:Number):void 
    {
        if (_layout)
            _layout.horizontalScrollPosition = value;
        else
            _layoutProperties.horizontalScrollPosition = value;
    }
    
    //----------------------------------
    //  verticalScrollPosition
    //----------------------------------
    
    [Bindable]
    
    /**
     *  @copy mx.core.IViewport#verticalScrollPosition
     */
    public function get verticalScrollPosition():Number 
    {
        return (_layout) 
            ? _layout.verticalScrollPosition 
            : _layoutProperties.verticalScrollPosition;
    }

    /**
     *  @private
     */
    public function set verticalScrollPosition(value:Number):void 
    {
        if (_layout)
            _layout.verticalScrollPosition = value;
        else
            _layoutProperties.verticalScrollPosition = value;
    }
    
    //----------------------------------
    //  clipContent
    //----------------------------------
    
    /**
     *  @copy mx.core.IViewport#clipContent
     */
    public function get clipContent():Boolean 
    {
        return (_layout) ? _layout.clipContent : _layoutProperties.clipContent;
    }

    /**
     *  @private
     */
    public function set clipContent(value:Boolean):void 
    {
        if (_layout)
            _layout.clipContent = value;
        else
            _layoutProperties.clipContent = value;
    }    
    
    //----------------------------------
    //  scrollRect
    //----------------------------------
    
    private var _scrollRectSet:Boolean = false;
    
    /**
     * @private
     * GroupBase workaround for a FP bug.  Ignore attempts to reset the
     * DisplayObject scrollRect property to null (its default value) if we've
     * never set it.  Similarly, don't read the DisplayObject scrollRect
     * property if its value has not been set.
     */
     override public function get scrollRect():Rectangle
     {
         return (!_scrollRectSet) ? null : super.scrollRect;
     }

     /**
      * @private 
      */
    override public function set scrollRect(value:Rectangle):void
    {
        if (!_scrollRectSet && !value)
            return;
        _scrollRectSet = true;
        super.scrollRect = value;
    }
    
    //----------------------------------
    //  autoLayout
    //----------------------------------

    /**
     *  @private
     *  Storage for the autoLayout property.
     */
    private var _autoLayout:Boolean = true;

    [Inspectable(defaultValue="true")]

    /**
     *  If <code>true</code>, measurement and layout are done
     *  when the position or size of a child is changed.
     *  If <code>false</code>, measurement and layout are done only once,
     *  when children are added to or removed from the container.
     *
     *  @default true
     */
    public function get autoLayout():Boolean
    {
        return _autoLayout;
    }

    /**
     *  @private
     */
    public function set autoLayout(value:Boolean):void
    {
        if (_autoLayout == value)
            return;

        _autoLayout = value;

        // If layout is being turned back on, trigger a layout to occur now.
        if (value)
        {
            invalidateSize();
            invalidateDisplayList();
            invalidateParentSizeAndDisplayList();
        }
    }

    //----------------------------------
    //  resizeMode
    //----------------------------------
    private static const _NORMAL_UINT:uint = 0;
    private static const _SCALE_UINT:uint = 1;
    private var _resizeMode:uint = _NORMAL_UINT;

    /**
     *  Converts from the <code>String</code> to the <code>uint</code>
     *  representation of the enumeration value.
     *
     *  @param value The String representation of the enumeration.
     *
     *  @return The uint value corresponding to the String.
     */
    private static function resizeModeToUINT(value:String):uint
    {
        if (value == ResizeMode.SCALE)
            return _SCALE_UINT;
        return _NORMAL_UINT;
    }

    /**
     *  Converts from the <code>uint</code> to the <code>String</code>
     *  representation of the enumeration values.
     *
     *  @param value The uint value of the enumeration. 
     *
     *  @return The String corresponding to the uint value.
     */
    private static function resizeModeToString(value:uint):String
    {
        if (value == _SCALE_UINT)
            return ResizeMode.SCALE;
        return ResizeMode.NORMAL;
    }
    
/**
 *  The ResizeMode for this container.  If the resize mode
 *  is set to <code>ResizeMode.NORMAL</code>, resizing is done by laying 
 *  out the children with our new width and height.  If the 
 *  resize mode is set to <code>ResizeMode.SCALE</code>, all of the children 
 *  keep their unscaled width and height and the children 
 *  are scaled to change size.
 * 
 * @default ResizeMode.NORMAL
 * 
 * @see mx.components.ResizeMode
 */
    public function get resizeMode():String
    {
        return resizeModeToString(_resizeMode);
    }
    
    public function set resizeMode(stringValue:String):void
    {
        var value:uint = resizeModeToUINT(stringValue); 
        if (_resizeMode == value)
            return;
            
        _resizeMode = value;
        
        if (_resizeMode == _SCALE_UINT)
        {
            super.scaleX = 1; 
            super.scaleY = 1;
        }

        // We need the measured values and _resizeMode affects
        // our measure (skipMeasure implementation checks resizeMode) so
        // we need to invalidate the size.
        invalidateSize();

        // TODO EGeorgie: can we directly call setActualSize instead?
        invalidateParentSizeAndDisplayList();
    }
    
    /**
     *  @private
     */
    override public function setActualSize(w:Number, h:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
        {
            // TODO EGeorgie: make sure we don't invalidate again while
            // setting the scale!
            if (measuredWidth != 0)
            {
                $scaleX = w / measuredWidth;
                w = measuredWidth;
            }
            if (measuredHeight != 0)
            {
                $scaleY = h / measuredHeight;
                h = measuredHeight;
            }
        }

        super.setActualSize(w, h);
    }
    
    /**
     *  The scaling factor of the container in the X direction. 
     * 
     *  <p>If <code>resizeMode</code> is set to <code>ResizeMode.SCALE</code>, 
     *  reading this property always returns 1.0, and setting it does nothing.</p>
     *
     *  <p>If <code>resizeMode</code> is set to anything other than <code>ResizeMode.SCALE</code>, 
     *  reading this property returns the current scaling factor.</p>
     *
     *  @copy mx.core.UIComponent#scaleX
     */    
    override public function get scaleX():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return 1;

        return super.scaleX;
    }

    /**
     *  @private
     */    
    override public function set scaleX(value:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
            return;

        super.scaleX = value;
    }
    
    /**
     *  The scaling factor of the container in the Y direction. 
     * 
     *  <p>If <code>resizeMode</code> is set to <code>ResizeMode.SCALE</code>, 
     *  reading this property always returns 1.0, and setting it does nothing.</p>
     *
     *  <p>If <code>resizeMode</code> is set to anything other than <code>ResizeMode.SCALE</code>, 
     *  reading this property returns the current scaling factor.</p>
     *
     *  @copy mx.core.UIComponent#scaleY
     */    
    override public function get scaleY():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return 1;

        return super.scaleY;
    }

    /**
     *  @private 
     */    
    override public function set scaleY(value:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
            return;

        super.scaleY = value;
    }

    [Bindable("widthChanged")]
    [Inspectable(category="General")]
    [PercentProxy("percentWidth")]
    /**
     *  The width of the container, in pixels. 
     */    
    override public function get width():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return super.width * $scaleX;

        return super.width;
    }
    
    [Bindable("heightChanged")]
    [Inspectable(category="General")]
    [PercentProxy("percentHeight")]
    /**
     *  The height of the container, in pixels. 
     */    
    override public function get height():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return super.height * $scaleY;

        return super.height;
    }
    
    /**
     *  @private
     */
    override protected function skipMeasure():Boolean
    {
        // We never want to skip measure, if we resize by scaling
        return _resizeMode == _SCALE_UINT ? false : super.skipMeasure();
    }

    /**
     *  @private
     */
    override protected function commitProperties():void
    {
        super.commitProperties();
                
        if (maskChanged)
        {
            maskChanged = false;
            if (_mask && !_mask.parent)
            {
            	// TODO!!! This needs to be a sibling because alpha
                super.addChild(_mask);
                var maskComp:UIComponent = _mask as UIComponent;
                if (maskComp)
                {
                    maskComp.validateSize();
                    maskComp.setActualSize(maskComp.getExplicitOrMeasuredWidth(), 
                                           maskComp.getExplicitOrMeasuredHeight());
                }
            }
        }
        
        if (maskTypeChanged)    
        {
            maskTypeChanged = false;
            <commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>package mx.components.baseClasses
{
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.utils.Dictionary;

import mx.events.FlexEvent;
import mx.events.ItemExistenceChangedEvent;
import mx.graphics.Graphic;

import mx.graphics.MaskType;
import mx.utils.MatrixUtil;
import mx.graphics.graphicsClasses.GraphicElement;
import mx.graphics.IGraphicElement;
import mx.layout.ILayoutItem;
import mx.core.IViewport;
import mx.core.ScrollUnit;
import mx.layout.LayoutBase;
import mx.layout.BasicLayout;
import mx.layout.LayoutItemFactory;

import mx.collections.ICollectionView;
import mx.collections.IList;
import mx.collections.ListCollectionView;
import mx.components.ResizeMode;
import mx.controls.Label;
import mx.core.IFactory;
import mx.core.mx_internal;
import mx.core.UIComponent;
import mx.events.CollectionEvent;
import mx.events.PropertyChangeEvent;
import mx.events.PropertyChangeEventKind;

use namespace mx_internal;

//--------------------------------------
//  Styles
//--------------------------------------

include "../../styles/metadata/BasicContainerFormatTextStyles.as"
include "../../styles/metadata/AdvancedContainerFormatTextStyles.as"
include "../../styles/metadata/BasicParagraphFormatTextStyles.as"
include "../../styles/metadata/AdvancedParagraphFormatTextStyles.as"
include "../../styles/metadata/BasicCharacterFormatTextStyles.as"
include "../../styles/metadata/AdvancedCharacterFormatTextStyles.as"
include "../../styles/metadata/SelectionFormatTextStyles.as"

[Exclude(name="enabled", kind="property")] 

/**
 *  The GroupBase class defines the base class for components that display visual elements.
 *  A group component does not control the layout of the visual items that it contains. 
 *  Instead, the layout is handled by a separate layout component.
 *
 *  @see mx.layout.LayoutBase
 *  @see mx.components.ResizeMode
 */
public class GroupBase extends UIComponent implements IViewport
{
    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------
    
    /**
     * Constructor.
     */
     public function GroupBase()
    {
        super();
        tabChildren = true;
        
        _layout = new BasicLayout();
        _layout.target = this;  
    }
        
    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
        
    //----------------------------------
    //  layout
    //----------------------------------    
        
    private var _layout:LayoutBase;  // initialized in the ctor
    private var _layoutProperties:Object = null;
    
    /**
     *  The layout object for this container.  
     *  This object determines how the visual elements are laid out in the container.
     */
    public function get layout():LayoutBase
    {
        return _layout;
    }
        
    /**
     *  Three properties are delegated to the layout: clipContent,
     *  verticalScrollPosition, horizontalScrollPosition.
     *  If the layout is reset, we copy the properties from the old
     *  layout to the new one.   If the new layout is null, then we
     *  temporarily store the delegated properties in _layoutProperties.
     *  
     *  @private
     */
    public function set layout(value:LayoutBase):void
    {
        if (_layout == value)
            return;

        if (value)
        {
            value.clipContent = clipContent;
            value.verticalScrollPosition = verticalScrollPosition;
            value.horizontalScrollPosition = horizontalScrollPosition;
            _layoutProperties = null;
        }
        else 
        {
            _layoutProperties = {
                verticalScrollPosition: _layout.verticalScrollPosition,
                horizontalScrollPosition: _layout.horizontalScrollPosition,
                clipContent: _layout.clipContent 
            };
        }

        if (_layout)
            _layout.target = null;
        _layout = value; 
        if (_layout)
            _layout.target = this;

        invalidateSize();
        invalidateDisplayList();
    }
    
    //----------------------------------
    //  horizontalScrollPosition
    //----------------------------------
        
    [Bindable]

    /**
     *  @copy mx.core.IViewport#horizontalScrollPosition
     */
    public function get horizontalScrollPosition():Number 
    {
        return (_layout) 
            ? _layout.horizontalScrollPosition 
            : _layoutProperties.horizontalScrollPosition;
    }

    /**
     *  @private
     */
    public function set horizontalScrollPosition(value:Number):void 
    {
        if (_layout)
            _layout.horizontalScrollPosition = value;
        else
            _layoutProperties.horizontalScrollPosition = value;
    }
    
    //----------------------------------
    //  verticalScrollPosition
    //----------------------------------
    
    [Bindable]
    
    /**
     *  @copy mx.core.IViewport#verticalScrollPosition
     */
    public function get verticalScrollPosition():Number 
    {
        return (_layout) 
            ? _layout.verticalScrollPosition 
            : _layoutProperties.verticalScrollPosition;
    }

    /**
     *  @private
     */
    public function set verticalScrollPosition(value:Number):void 
    {
        if (_layout)
            _layout.verticalScrollPosition = value;
        else
            _layoutProperties.verticalScrollPosition = value;
    }
    
    //----------------------------------
    //  clipContent
    //----------------------------------
    
    /**
     *  @copy mx.core.IViewport#clipContent
     */
    public function get clipContent():Boolean 
    {
        return (_layout) ? _layout.clipContent : _layoutProperties.clipContent;
    }

    /**
     *  @private
     */
    public function set clipContent(value:Boolean):void 
    {
        if (_layout)
            _layout.clipContent = value;
        else
            _layoutProperties.clipContent = value;
    }    
    
    //----------------------------------
    //  scrollRect
    //----------------------------------
    
    private var _scrollRectSet:Boolean = false;
    
    /**
     * @private
     * GroupBase workaround for a FP bug.  Ignore attempts to reset the
     * DisplayObject scrollRect property to null (its default value) if we've
     * never set it.  Similarly, don't read the DisplayObject scrollRect
     * property if its value has not been set.
     */
     override public function get scrollRect():Rectangle
     {
         return (!_scrollRectSet) ? null : super.scrollRect;
     }

     /**
      * @private 
      */
    override public function set scrollRect(value:Rectangle):void
    {
        if (!_scrollRectSet && !value)
            return;
        _scrollRectSet = true;
        super.scrollRect = value;
    }
    
    //----------------------------------
    //  autoLayout
    //----------------------------------

    /**
     *  @private
     *  Storage for the autoLayout property.
     */
    private var _autoLayout:Boolean = true;

    [Inspectable(defaultValue="true")]

    /**
     *  If <code>true</code>, measurement and layout are done
     *  when the position or size of a child is changed.
     *  If <code>false</code>, measurement and layout are done only once,
     *  when children are added to or removed from the container.
     *
     *  @default true
     */
    public function get autoLayout():Boolean
    {
        return _autoLayout;
    }

    /**
     *  @private
     */
    public function set autoLayout(value:Boolean):void
    {
        if (_autoLayout == value)
            return;

        _autoLayout = value;

        // If layout is being turned back on, trigger a layout to occur now.
        if (value)
        {
            invalidateSize();
            invalidateDisplayList();
            invalidateParentSizeAndDisplayList();
        }
    }

    //----------------------------------
    //  resizeMode
    //----------------------------------
    private static const _NORMAL_UINT:uint = 0;
    private static const _SCALE_UINT:uint = 1;
    private var _resizeMode:uint = _NORMAL_UINT;

    /**
     *  Converts from the <code>String</code> to the <code>uint</code>
     *  representation of the enumeration value.
     *
     *  @param value The String representation of the enumeration.
     *
     *  @return The uint value corresponding to the String.
     */
    private static function resizeModeToUINT(value:String):uint
    {
        if (value == ResizeMode.SCALE)
            return _SCALE_UINT;
        return _NORMAL_UINT;
    }

    /**
     *  Converts from the <code>uint</code> to the <code>String</code>
     *  representation of the enumeration values.
     *
     *  @param value The uint value of the enumeration. 
     *
     *  @return The String corresponding to the uint value.
     */
    private static function resizeModeToString(value:uint):String
    {
        if (value == _SCALE_UINT)
            return ResizeMode.SCALE;
        return ResizeMode.NORMAL;
    }
    
/**
 *  The ResizeMode for this container.  If the resize mode
 *  is set to <code>ResizeMode.NORMAL</code>, resizing is done by laying 
 *  out the children with our new width and height.  If the 
 *  resize mode is set to <code>ResizeMode.SCALE</code>, all of the children 
 *  keep their unscaled width and height and the children 
 *  are scaled to change size.
 * 
 * @default ResizeMode.NORMAL
 * 
 * @see mx.components.ResizeMode
 */
    public function get resizeMode():String
    {
        return resizeModeToString(_resizeMode);
    }
    
    public function set resizeMode(stringValue:String):void
    {
        var value:uint = resizeModeToUINT(stringValue); 
        if (_resizeMode == value)
            return;
            
        _resizeMode = value;
        
        if (_resizeMode == _SCALE_UINT)
        {
            super.scaleX = 1; 
            super.scaleY = 1;
        }

        // We need the measured values and _resizeMode affects
        // our measure (skipMeasure implementation checks resizeMode) so
        // we need to invalidate the size.
        invalidateSize();

        // TODO EGeorgie: can we directly call setActualSize instead?
        invalidateParentSizeAndDisplayList();
    }
    
    /**
     *  @private
     */
    override public function setActualSize(w:Number, h:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
        {
            // TODO EGeorgie: make sure we don't invalidate again while
            // setting the scale!
            if (measuredWidth != 0)
            {
                $scaleX = w / measuredWidth;
                w = measuredWidth;
            }
            if (measuredHeight != 0)
            {
                $scaleY = h / measuredHeight;
                h = measuredHeight;
            }
        }

        super.setActualSize(w, h);
    }
    
    /**
     *  The scaling factor of the container in the X direction. 
     * 
     *  <p>If <code>resizeMode</code> is set to <code>ResizeMode.SCALE</code>, 
     *  reading this property always returns 1.0, and setting it does nothing.</p>
     *
     *  <p>If <code>resizeMode</code> is set to anything other than <code>ResizeMode.SCALE</code>, 
     *  reading this property returns the current scaling factor.</p>
     *
     *  @copy mx.core.UIComponent#scaleX
     */    
    override public function get scaleX():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return 1;

        return super.scaleX;
    }

    /**
     *  @private
     */    
    override public function set scaleX(value:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
            return;

        super.scaleX = value;
    }
    
    /**
     *  The scaling factor of the container in the Y direction. 
     * 
     *  <p>If <code>resizeMode</code> is set to <code>ResizeMode.SCALE</code>, 
     *  reading this property always returns 1.0, and setting it does nothing.</p>
     *
     *  <p>If <code>resizeMode</code> is set to anything other than <code>ResizeMode.SCALE</code>, 
     *  reading this property returns the current scaling factor.</p>
     *
     *  @copy mx.core.UIComponent#scaleY
     */    
    override public function get scaleY():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return 1;

        return super.scaleY;
    }

    /**
     *  @private 
     */    
    override public function set scaleY(value:Number):void
    {
        if (_resizeMode == _SCALE_UINT)
            return;

        super.scaleY = value;
    }

    [Bindable("widthChanged")]
    [Inspectable(category="General")]
    [PercentProxy("percentWidth")]
    /**
     *  The width of the container, in pixels. 
     */    
    override public function get width():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return super.width * $scaleX;

        return super.width;
    }
    
    [Bindable("heightChanged")]
    [Inspectable(category="General")]
    [PercentProxy("percentHeight")]
    /**
     *  The height of the container, in pixels. 
     */    
    override public function get height():Number
    {
        if (_resizeMode == _SCALE_UINT)
            return super.height * $scaleY;

        return super.height;
    }
    
    /**
     *  @private
     */
    override protected function skipMeasure():Boolean
    {
        // We never want to skip measure, if we resize by scaling
        return _resizeMode == _SCALE_UINT ? false : super.skipMeasure();
    }

    /**
     *  @private
     */
    override protected function commitProperties():void
    {
        super.commitProperties();
                
        if (maskChanged)
        {
            maskChanged = false;
            if (_mask)
            {
            	maskTypeChanged = true;
            
	            if (!_mask.parent)
            {
            	// TODO!!! This needs to be a sibling because alpha
                super.addChild(_mask);
                var maskComp:UIComponent = _mask as UIComponent;
                if (maskComp)
                {
	                	maskComp.validateProperties();
                    maskComp.validateSize();
                    maskComp.setActualSize(maskComp.getExplicitOrMeasuredWidth(), 
                                           maskComp.getExplicitOrMeasuredHeight());
                }
            }
        }
        }
        
        if (maskTypeChanged)    
        {
            maskTypeChanged = false;
            
{'fraction_non_alphanumeric': 0.14395451930560726, 'fraction_numerical': 0.000812155257013299, 'mean_word_length': 1.6504035874439462, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1567517', 'n_tokens_mistral': 7715, 'n_tokens_neox': 7605, 'n_words': 1967}