<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  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
{

import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
import flash.text.engine.FontLookup;
import flash.text.engine.TextLine;

import flashx.textLayout.compose.TextLineRecycler;

import mx.core.IEmbeddedFontRegistry;
import mx.core.IFlexModuleFactory;
import mx.core.IFontContextComponent;
import mx.core.UIComponent;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.managers.ISystemManager;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IAdvancedStyleClient;
import mx.styles.StyleManager;
import mx.styles.StyleProtoChain;
import mx.utils.NameUtil;

import spark.utils.TextUtil;

use namespace mx_internal;

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

/**
 *  The alpha level of the color defined by
 *  the <code>backgroundColor</code> style.
 *  Valid values range from 0.0 to 1.0.
 * 
 *  @default 1.0
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Style(name="backgroundAlpha", type="Number", inherit="no", minValue="0.0", maxValue="1.0")]

/**
 *  The color of the background of the entire
 *  bounding rectangle of this component.
 *  If this style is <code>undefined</code>,
 *  no background is drawn.
 *  Otherwise, this RGB color is drawn with an alpha level
 *  determined by the <code>backgroundAlpha</code> style.
 * 
 *  @default undefined
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]

 //--------------------------------------------------------------------------
 // Other metadata for accessibility API
 //-------------------------------------------------------------------------
[AccessibilityClass(implementation="spark.accessibility.TextBaseAccImpl")]  

/**
 *  The base class for Spark text controls such as Label and RichText
 *  which display text using CSS styles for the default format.
 *
 *  <p>In addition to adding a <code>text</code> property,
 *  this class also adds the <code>maxDisplayedLines</code>
 *  and <code>isTruncated</code> properties to support truncation.</p>
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */

public class TextBase extends UIComponent
{

    include "../../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Most resources are fetched on the fly from the ResourceManager,
     *  so they automatically get the right resource when the locale changes.
     *  But since truncation can happen frequently,
     *  this class caches this resource value in this variable
     *  and updates it when the locale changes.
     */ 
    mx_internal static var truncationIndicatorResource:String;

    /**
     *  @private
     *  Mixins for accessibility
     */
    mx_internal static var createAccessibilityImplementation:Function;		

    /**
     *  @private
     *  Accessibility initialization function
     */
   
    override protected function initializeAccessibility():void
    {
      if (TextBase.createAccessibilityImplementation != null)
        TextBase.createAccessibilityImplementation(this);
    }

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor. 
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     */
    public function TextBase()
    {
        super();
        
        // set mouseChildren to false so that the TextLines that get 
        // added don't trap the mouse events.
        mouseChildren = false;
		
		// this component assumes that its coordinate system will not be mirrored
		layoutDirection = "ltr";
        
		var resourceManager:IResourceManager = ResourceManager.getInstance();
                                    
		if (!truncationIndicatorResource)
        {
            truncationIndicatorResource = resourceManager.getString(
                "core", "truncationIndicator");
        }
        
        addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
                
        // Register as a weak listener for "change" events from ResourceManager.
        // If TextBases registered as a strong listener,
        // they wouldn't get garbage collected.
        resourceManager.addEventListener(
            Event.CHANGE, resourceManager_changeHandler, false, 0, true);
        
        // Our background fill. 
        _backgroundShape = new Shape();
        addChild(_backgroundShape);
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  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
{

import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
import flash.text.engine.FontLookup;
import flash.text.engine.TextLine;

import flashx.textLayout.compose.TextLineRecycler;

import mx.core.IEmbeddedFontRegistry;
import mx.core.IFlexModuleFactory;
import mx.core.IFontContextComponent;
import mx.core.UIComponent;
import mx.core.mx_internal;
import mx.events.FlexEvent;
import mx.managers.ISystemManager;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;
import mx.styles.CSSStyleDeclaration;
import mx.styles.IAdvancedStyleClient;
import mx.styles.StyleManager;
import mx.styles.StyleProtoChain;
import mx.utils.NameUtil;

import spark.utils.TextUtil;

use namespace mx_internal;

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

/**
 *  The alpha level of the color defined by
 *  the <code>backgroundColor</code> style.
 *  Valid values range from 0.0 to 1.0.
 * 
 *  @default 1.0
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Style(name="backgroundAlpha", type="Number", inherit="no", minValue="0.0", maxValue="1.0")]

/**
 *  The color of the background of the entire
 *  bounding rectangle of this component.
 *  If this style is <code>undefined</code>,
 *  no background is drawn.
 *  Otherwise, this RGB color is drawn with an alpha level
 *  determined by the <code>backgroundAlpha</code> style.
 * 
 *  @default undefined
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */
[Style(name="backgroundColor", type="uint", format="Color", inherit="no")]

 //--------------------------------------------------------------------------
 // Other metadata for accessibility API
 //-------------------------------------------------------------------------
[AccessibilityClass(implementation="spark.accessibility.TextBaseAccImpl")]  

/**
 *  The base class for Spark text controls such as Label and RichText
 *  which display text using CSS styles for the default format.
 *
 *  <p>In addition to adding a <code>text</code> property,
 *  this class also adds the <code>maxDisplayedLines</code>
 *  and <code>isTruncated</code> properties to support truncation.</p>
 *
 *  @langversion 3.0
 *  @playerversion Flash 10
 *  @playerversion AIR 1.5
 *  @productversion Flex 4
 */

public class TextBase extends UIComponent
{

    include "../../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Most resources are fetched on the fly from the ResourceManager,
     *  so they automatically get the right resource when the locale changes.
     *  But since truncation can happen frequently,
     *  this class caches this resource value in this variable
     *  and updates it when the locale changes.
     */ 
    mx_internal static var truncationIndicatorResource:String;

    /**
     *  @private
     *  Mixins for accessibility
     */
    mx_internal static var createAccessibilityImplementation:Function;		

    /**
     *  @private
     *  Accessibility initialization function
     */
   
    override protected function initializeAccessibility():void
    {
      if (TextBase.createAccessibilityImplementation != null)
        TextBase.createAccessibilityImplementation(this);
    }

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor. 
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     */
    public function TextBase()
    {
        super();
        
        // set mouseChildren to false so that the TextLines that get 
        // added don't trap the mouse events.
        mouseChildren = false;
		
		var resourceManager:IResourceManager = ResourceManager.getInstance();
                                    
		if (!truncationIndicatorResource)
        {
            truncationIndicatorResource = resourceManager.getString(
                "core", "truncationIndicator");
        }
        
        addEventListener(FlexEvent.UPDATE_COMPLETE, updateCompleteHandler);
                
        // Register as a weak listener for "change" events from ResourceManager.
        // If TextBases registered as a strong listener,
        // they wouldn't get garbage collected.
        resourceManager.addEventListener(
            Event.CHANGE, resourceManager_changeHandler, false, 0, true);
        
        // Our background fill. 
        _backgroundShape = new Shape();
        addChild(_backgroundShape);
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables
{'fraction_non_alphanumeric': 0.21350572202323753, 'fraction_numerical': 0.007512885472176116, 'mean_word_length': 1.7826932425862907, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4334755', 'n_tokens_mistral': 2891, 'n_tokens_neox': 2764, 'n_words': 813}