/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { ITrackShadeVisual_$type } from "./ITrackShadeVisual";
import { Path } from "igniteui-react-core/ES5/Path";
import { Base, Point_$type, markType } from "igniteui-react-core/ES5/type";
import { List$1 } from "igniteui-react-core/ES5/List$1";
import { Brush } from "igniteui-react-core/ES5/Brush";
import { Color } from "igniteui-react-core/ES5/Color";
import { PathGeometry } from "igniteui-react-core/ES5/PathGeometry";
import { PathFigure } from "igniteui-react-core/ES5/PathFigure";
import { PolyLineSegment } from "igniteui-react-core/ES5/PolyLineSegment";
var DefaultTrackShadeVisual = /** @class */ (function (_super) {
    tslib_1.__extends(DefaultTrackShadeVisual, _super);
    function DefaultTrackShadeVisual() {
        var _this = _super.call(this) || this;
        _this._translateX = 0;
        _this._translateY = 0;
        _this.a = 0;
        _this.c = -1;
        _this.b = -1;
        _this._shadeBox = null;
        _this._shadeOutline = null;
        _this._allPaths = null;
        _this.shadeBox = new Path();
        _this.shadeOutline = new Path();
        _this.allPaths = new List$1(Path.$, 0);
        _this.allPaths.add(_this.shadeBox);
        _this.allPaths.add(_this.shadeOutline);
        _this.shadeBox._fill = _this.getShadeBoxDefaultBrush();
        _this.shadeOutline._stroke = _this.getShadeOutlineDefaultBrush();
        _this.shadeOutline.ac = _this.getShadeOutlineDefaultStrokeThickness();
        return _this;
    }
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "translateX", {
        get: function () {
            return this._translateX;
        },
        set: function (a) {
            this._translateX = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "translateY", {
        get: function () {
            return this._translateY;
        },
        set: function (a) {
            this._translateY = a;
        },
        enumerable: true,
        configurable: true
    });
    DefaultTrackShadeVisual.prototype.getShadeBoxDefaultBrush = function () {
        return ((function () {
            var $ret = new Brush();
            $ret.color = Color.u(128, 255, 255, 255);
            return $ret;
        })());
    };
    DefaultTrackShadeVisual.prototype.getShadeOutlineDefaultBrush = function () {
        return ((function () {
            var $ret = new Brush();
            $ret.color = Color.u(255, 185, 185, 185);
            return $ret;
        })());
    };
    DefaultTrackShadeVisual.prototype.getShadeOutlineDefaultStrokeThickness = function () {
        return 1;
    };
    DefaultTrackShadeVisual.prototype.d = function () {
        var a = new PathGeometry();
        var b = new PathFigure();
        var c = new PolyLineSegment();
        b._isClosed = true;
        b._isFilled = true;
        b._startPoint = { $type: Point_$type, x: this.width / -2, y: this.height / -2 };
        c._points.add({ $type: Point_$type, x: this.width / 2, y: this.height / -2 });
        c._points.add({ $type: Point_$type, x: this.width / 2, y: this.height / 2 });
        c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / 2 });
        b._segments.add(c);
        a.b.add(b);
        this.shadeBox.aj = a;
    };
    DefaultTrackShadeVisual.prototype.e = function () {
        var a = new PathGeometry();
        var b = new PathFigure();
        var c = new PolyLineSegment();
        b._isClosed = false;
        b._isFilled = false;
        switch (this.orientation) {
            case 0:
                b._startPoint = { $type: Point_$type, x: this.width / -2, y: this.height / -2 };
                c._points.add({ $type: Point_$type, x: this.width / 2, y: this.height / -2 });
                c._points.add({ $type: Point_$type, x: this.width / 2, y: this.height / 2 });
                break;
            case 1:
                b._startPoint = { $type: Point_$type, x: this.width / -2, y: this.height / 2 };
                c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / -2 });
                c._points.add({ $type: Point_$type, x: this.width / 2, y: this.height / -2 });
                break;
            case 2:
                b._startPoint = { $type: Point_$type, x: this.width / 2, y: this.height / 2 };
                c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / 2 });
                c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / -2 });
                break;
            case 3:
                b._startPoint = { $type: Point_$type, x: this.width / 2, y: this.height / -2 };
                c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / -2 });
                c._points.add({ $type: Point_$type, x: this.width / -2, y: this.height / 2 });
                break;
        }
        b._segments.add(c);
        a.b.add(b);
        this.shadeOutline.aj = a;
    };
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "orientation", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            this.a = a;
            if (b != this.a) {
                this.f();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "width", {
        get: function () {
            return this.c;
        },
        set: function (a) {
            var b = this.c;
            this.c = a;
            if (b != this.c) {
                this.f();
            }
        },
        enumerable: true,
        configurable: true
    });
    DefaultTrackShadeVisual.prototype.f = function () {
        if (this.width > 0 && this.height > 0) {
            this.d();
            this.e();
        }
    };
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "height", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            if (this.b != b) {
                this.f();
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "shadeBox", {
        get: function () {
            return this._shadeBox;
        },
        set: function (a) {
            this._shadeBox = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "shadeOutline", {
        get: function () {
            return this._shadeOutline;
        },
        set: function (a) {
            this._shadeOutline = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DefaultTrackShadeVisual.prototype, "allPaths", {
        get: function () {
            return this._allPaths;
        },
        set: function (a) {
            this._allPaths = a;
        },
        enumerable: true,
        configurable: true
    });
    DefaultTrackShadeVisual.$t = markType(DefaultTrackShadeVisual, 'DefaultTrackShadeVisual', Base.$, [ITrackShadeVisual_$type]);
    return DefaultTrackShadeVisual;
}(Base));
export { DefaultTrackShadeVisual };
