<commit_before>import ColorTransform			= require("awayjs-core/lib/geom/ColorTransform");
import EventDispatcher = require("awayjs-core/lib/events/EventDispatcher");
import Matrix = require("awayjs-core/lib/geom/Matrix");
import DisplayObjectContainer = require("awayjs-display/lib/containers/DisplayObjectContainer");

import AS2SharedObjectAdapter = require("awayjs-player/lib/adapters/AS2SharedObjectAdapter");
import AS2MovieClipAdapter = require("awayjs-player/lib/adapters/AS2MovieClipAdapter");
import AS2KeyAdapter = require("awayjs-player/lib/adapters/AS2KeyAdapter");
import AS2MouseAdapter = require("awayjs-player/lib/adapters/AS2MouseAdapter");
import AS2StageAdapter = require("awayjs-player/lib/adapters/AS2StageAdapter");
import MovieClip = require("awayjs-player/lib/display/MovieClip");

// also contains global AS2 gunctions
class AS2SymbolAdapter
{
    // TODO: REMOVE AND PROVIDE AS CLASS (See System) ONCE TRANSLATOR IS FIXED
    // And then change properties to statics
    public get Key() { return AS2KeyAdapter; }
    public get Mouse() { return AS2MouseAdapter; }
    public get Stage() { return AS2StageAdapter; }
    public get SharedObject() { return AS2SharedObjectAdapter; }

    // blendMode
    // cacheAsBitmap
    // filters
    // _focusrect: Boolean
    // _highquality: Number // DEPRECATED ANYWAY
    // menu: ContextMenu
    // scale9Grid: Rectangle
    // _soundbuftime: Number
    // tabEnabled: Boolean
    // tabIndex: Number
    // _target: String  [read-only]
    // trackAsMenu: Boolean
    // _url: String [read-only]
    // useHandCursor: Boolean

    // _height: Number
    // _width: Number

    // _xmouse: Number [read-only]
    // _ymouse: Number [read-only]

    // id (renamed to instanceID)

    /*public onDragOut : Function;
    public onDragOver : Function;
    public onKeyDown : Function;
    public onKeyUp : Function;
    public onKillFocus : Function;
    public onPress : Function;
    public onRelease : Function;
    public onReleaseOutside : Function;
    public onRollOut : Function;
    public onRollOver : Function;
    public onSetFocus : Function;*/

    private __root : AS2SymbolAdapter;

    private _adaptee : DisplayObjectContainer;

    private __quality : string = "high";


    private static REFERENCE_TIME : number = -1;
    private static CLASS_REPLACEMENTS : Object;

    constructor(adaptee : DisplayObjectContainer)
    {
        this._adaptee = adaptee;

        if (AS2SymbolAdapter.REFERENCE_TIME === -1)
            AS2SymbolAdapter.REFERENCE_TIME = new Date().getTime();

        if (!AS2SymbolAdapter.CLASS_REPLACEMENTS) {
            AS2SymbolAdapter.CLASS_REPLACEMENTS = {};
            AS2SymbolAdapter.CLASS_REPLACEMENTS["Color"] = "awayjs-player/lib/adapters/AS2ColorAdapter";
            AS2SymbolAdapter.CLASS_REPLACEMENTS["System"] = "awayjs-player/lib/adapters/AS2SystemAdapter";
            AS2SymbolAdapter.CLASS_REPLACEMENTS["Sound"] = "awayjs-player/lib/adapters/AS2SoundAdapter";
        }
    }

    getVersion() : number
    {
        return 0;
    }

    get adaptee() : DisplayObjectContainer
    {
        return this._adaptee;
    }

    get _name() : string
    {
        return this._adaptee.name;
    }

    get _rotation() : number
    {
        return this._adaptee.rotationZ;
    }

    set _rotation(value : number)
    {
        this._adaptee.rotationZ = value;
    }

    get _x() : number
    {
        return this._adaptee.x;
    }

    set _x(value : number)
    {
        this._adaptee.x = value;
    }

    get _y() : number
    {
        return this._adaptee.y;
    }

    set _y(value : number)
    {
        this._adaptee.y = value;
    }

    get _xscale() : number
    {
        return this._adaptee.scaleX;
    }

    set _xscale(value : number)
    {
        this._adaptee.scaleX = value;
    }

    set _yscale(value : number)
    {
        this._adaptee.scaleY = value;
    }

    get _yscale() : number
    {
        return this._adaptee.scaleY;
    }

    get _visible() : boolean
    {
        return this._adaptee.visible;
    }

    set _visible(value : boolean)
    {
        this._adaptee.visible = value;
    }

    getDepth() : number
    {
        return this._adaptee.z;
    }

    // just assure consistency for scripts, doesn't actually effect rendering.
    get _quality() : string
    {
        return this.__quality;
    }

    set quality(value : string)
    {
        this.__quality = value;
    }

    trace() : void
    {
        //console.log.apply(window, arguments);
    }

    // may need proper high-def timer mechanism
    getTimer() : Number
    {
        return new Date().getTime() - AS2SymbolAdapter.REFERENCE_TIME;
    }

    int(value:any) : number
    {
        return value | 0;
    }

    get _alpha() : number
    {
        return this.adaptee.transform.colorTransform.alphaMultiplier;
    }

    set _alpha(value: number)
    {
        if (!this.adaptee.transform.colorTransform)<commit_msg>fix for get _alpha null<commit_after>import ColorTransform			= require("awayjs-core/lib/geom/ColorTransform");
import EventDispatcher = require("awayjs-core/lib/events/EventDispatcher");
import Matrix = require("awayjs-core/lib/geom/Matrix");
import DisplayObjectContainer = require("awayjs-display/lib/containers/DisplayObjectContainer");

import AS2SharedObjectAdapter = require("awayjs-player/lib/adapters/AS2SharedObjectAdapter");
import AS2MovieClipAdapter = require("awayjs-player/lib/adapters/AS2MovieClipAdapter");
import AS2KeyAdapter = require("awayjs-player/lib/adapters/AS2KeyAdapter");
import AS2MouseAdapter = require("awayjs-player/lib/adapters/AS2MouseAdapter");
import AS2StageAdapter = require("awayjs-player/lib/adapters/AS2StageAdapter");
import MovieClip = require("awayjs-player/lib/display/MovieClip");

// also contains global AS2 gunctions
class AS2SymbolAdapter
{
    // TODO: REMOVE AND PROVIDE AS CLASS (See System) ONCE TRANSLATOR IS FIXED
    // And then change properties to statics
    public get Key() { return AS2KeyAdapter; }
    public get Mouse() { return AS2MouseAdapter; }
    public get Stage() { return AS2StageAdapter; }
    public get SharedObject() { return AS2SharedObjectAdapter; }

    // blendMode
    // cacheAsBitmap
    // filters
    // _focusrect: Boolean
    // _highquality: Number // DEPRECATED ANYWAY
    // menu: ContextMenu
    // scale9Grid: Rectangle
    // _soundbuftime: Number
    // tabEnabled: Boolean
    // tabIndex: Number
    // _target: String  [read-only]
    // trackAsMenu: Boolean
    // _url: String [read-only]
    // useHandCursor: Boolean

    // _height: Number
    // _width: Number

    // _xmouse: Number [read-only]
    // _ymouse: Number [read-only]

    // id (renamed to instanceID)

    /*public onDragOut : Function;
    public onDragOver : Function;
    public onKeyDown : Function;
    public onKeyUp : Function;
    public onKillFocus : Function;
    public onPress : Function;
    public onRelease : Function;
    public onReleaseOutside : Function;
    public onRollOut : Function;
    public onRollOver : Function;
    public onSetFocus : Function;*/

    private __root : AS2SymbolAdapter;

    private _adaptee : DisplayObjectContainer;

    private __quality : string = "high";


    private static REFERENCE_TIME : number = -1;
    private static CLASS_REPLACEMENTS : Object;

    constructor(adaptee : DisplayObjectContainer)
    {
        this._adaptee = adaptee;

        if (AS2SymbolAdapter.REFERENCE_TIME === -1)
            AS2SymbolAdapter.REFERENCE_TIME = new Date().getTime();

        if (!AS2SymbolAdapter.CLASS_REPLACEMENTS) {
            AS2SymbolAdapter.CLASS_REPLACEMENTS = {};
            AS2SymbolAdapter.CLASS_REPLACEMENTS["Color"] = "awayjs-player/lib/adapters/AS2ColorAdapter";
            AS2SymbolAdapter.CLASS_REPLACEMENTS["System"] = "awayjs-player/lib/adapters/AS2SystemAdapter";
            AS2SymbolAdapter.CLASS_REPLACEMENTS["Sound"] = "awayjs-player/lib/adapters/AS2SoundAdapter";
        }
    }

    getVersion() : number
    {
        return 0;
    }

    get adaptee() : DisplayObjectContainer
    {
        return this._adaptee;
    }

    get _name() : string
    {
        return this._adaptee.name;
    }

    get _rotation() : number
    {
        return this._adaptee.rotationZ;
    }

    set _rotation(value : number)
    {
        this._adaptee.rotationZ = value;
    }

    get _x() : number
    {
        return this._adaptee.x;
    }

    set _x(value : number)
    {
        this._adaptee.x = value;
    }

    get _y() : number
    {
        return this._adaptee.y;
    }

    set _y(value : number)
    {
        this._adaptee.y = value;
    }

    get _xscale() : number
    {
        return this._adaptee.scaleX;
    }

    set _xscale(value : number)
    {
        this._adaptee.scaleX = value;
    }

    set _yscale(value : number)
    {
        this._adaptee.scaleY = value;
    }

    get _yscale() : number
    {
        return this._adaptee.scaleY;
    }

    get _visible() : boolean
    {
        return this._adaptee.visible;
    }

    set _visible(value : boolean)
    {
        this._adaptee.visible = value;
    }

    getDepth() : number
    {
        return this._adaptee.z;
    }

    // just assure consistency for scripts, doesn't actually effect rendering.
    get _quality() : string
    {
        return this.__quality;
    }

    set quality(value : string)
    {
        this.__quality = value;
    }

    trace() : void
    {
        //console.log.apply(window, arguments);
    }

    // may need proper high-def timer mechanism
    getTimer() : Number
    {
        return new Date().getTime() - AS2SymbolAdapter.REFERENCE_TIME;
    }

    int(value:any) : number
    {
        return value | 0;
    }

    get _alpha() : number
    {
        return this.adaptee.transform.colorTransform.alphaMultiplier || 1;
    }

    set _alpha(value: number)
    {
        if (!this.adaptee.transform.colorTransform)
{'fraction_non_alphanumeric': 0.10558069381598793, 'fraction_numerical': 0.006737053795877326, 'mean_word_length': 2.528201489890032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3691494', 'n_tokens_mistral': 3153, 'n_tokens_neox': 2990, 'n_words': 638}