/*
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 { Base, Point_$type, markType } from "igniteui-react-core/ES2015/type";
import { ITrackShadeVisual_$type } from "./ITrackShadeVisual";
import { Path } from "igniteui-react-core/ES2015/Path";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { Color } from "igniteui-react-core/ES2015/Color";
import { PathGeometry } from "igniteui-react-core/ES2015/PathGeometry";
import { PathFigure } from "igniteui-react-core/ES2015/PathFigure";
import { PolyLineSegment } from "igniteui-react-core/ES2015/PolyLineSegment";
/**
 * @hidden
 */
export class DefaultTrackShadeVisual extends Base {
    constructor() {
        super();
        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();
    }
    get translateX() {
        return this._translateX;
    }
    set translateX(a) {
        this._translateX = a;
    }
    get translateY() {
        return this._translateY;
    }
    set translateY(a) {
        this._translateY = a;
    }
    getShadeBoxDefaultBrush() {
        return ((() => {
            let $ret = new Brush();
            $ret.color = Color.u(128, 255, 255, 255);
            return $ret;
        })());
    }
    getShadeOutlineDefaultBrush() {
        return ((() => {
            let $ret = new Brush();
            $ret.color = Color.u(255, 185, 185, 185);
            return $ret;
        })());
    }
    getShadeOutlineDefaultStrokeThickness() {
        return 1;
    }
    d() {
        let a = new PathGeometry();
        let b = new PathFigure();
        let 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;
    }
    e() {
        let a = new PathGeometry();
        let b = new PathFigure();
        let 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;
    }
    get orientation() {
        return this.a;
    }
    set orientation(a) {
        let b = this.a;
        this.a = a;
        if (b != this.a) {
            this.f();
        }
    }
    get width() {
        return this.c;
    }
    set width(a) {
        let b = this.c;
        this.c = a;
        if (b != this.c) {
            this.f();
        }
    }
    f() {
        if (this.width > 0 && this.height > 0) {
            this.d();
            this.e();
        }
    }
    get height() {
        return this.b;
    }
    set height(a) {
        let b = this.b;
        this.b = a;
        if (this.b != b) {
            this.f();
        }
    }
    get shadeBox() {
        return this._shadeBox;
    }
    set shadeBox(a) {
        this._shadeBox = a;
    }
    get shadeOutline() {
        return this._shadeOutline;
    }
    set shadeOutline(a) {
        this._shadeOutline = a;
    }
    get allPaths() {
        return this._allPaths;
    }
    set allPaths(a) {
        this._allPaths = a;
    }
}
DefaultTrackShadeVisual.$t = markType(DefaultTrackShadeVisual, 'DefaultTrackShadeVisual', Base.$, [ITrackShadeVisual_$type]);
