/*
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 { IgrNumericXAxis } from './igr-numeric-x-axis';
import { IgrNumericYAxis } from './igr-numeric-y-axis';
import { IgrSeries } from './igr-series';
import { delegateCombine, delegateRemove } from "igniteui-react-core/ES2015/type";
import { StyleShapeEventArgs } from './igr-style-shape-event-args';
/**
 * Series class for rendering polygons.
*/
export class IgrShapeSeriesBase extends IgrSeries {
    constructor(props) {
        super(props);
        this._styleShape = null;
        this._styleShape_wrapped = null;
    }
    set xAxisName(value) {
        this._xAxisName = value;
    }
    get xAxisName() {
        return this._xAxisName;
    }
    set yAxisName(value) {
        this._yAxisName = value;
    }
    get yAxisName() {
        return this._yAxisName;
    }
    bindAxes(axes) {
        for (let i = 0; i < axes.length; i++) {
            if (axes[i].name == this.xAxisName) {
                this.xAxis = axes[i];
            }
            if (axes[i].name == this.yAxisName) {
                this.yAxis = axes[i];
            }
        }
    }
    get i() {
        return this._implementation;
    }
    /**
 * The name of the property on ItemsSource items which, for each shape, contains a list of points to be converted to a polygon.
 * To be consistent with the Shapefile technical description, it is expected that each list of points is defined as an IEnumerable of IEnumerable of Point, or in other words, a list of lists of points.
*/
    get shapeMemberPath() {
        return this.i.mm;
    }
    set shapeMemberPath(v) {
        this.i.mm = v;
    }
    /**
     * Gets or sets the effective x-axis for the current ScatterBase object.
    */
    get xAxis() {
        if (this.i.lz == null) {
            return null;
        }
        if (!this.i.lz.externalObject) {
            let e = new IgrNumericXAxis(null);
            e._implementation = this.i.lz;
            this.i.lz.externalObject = e;
        }
        return this.i.lz.externalObject;
    }
    set xAxis(v) {
        v == null ? this.i.lz = null : this.i.lz = v.i;
    }
    /**
     * Gets or sets the effective y-axis for the current ScatterBase object.
    */
    get yAxis() {
        if (this.i.l1 == null) {
            return null;
        }
        if (!this.i.l1.externalObject) {
            let e = new IgrNumericYAxis(null);
            e._implementation = this.i.l1;
            this.i.l1.externalObject = e;
        }
        return this.i.l1.externalObject;
    }
    set yAxis(v) {
        v == null ? this.i.l1 = null : this.i.l1 = v.i;
    }
    /**
     * The resolution at which to filter out shapes in the series.  For example, if the ShapeFilterResolution is set to 3, then elements with a bounding rectangle smaller than 3 X 3 pixels will be filtered out.
     * In the case of ScatterPolylineSeries, the resolution is compared to either dimension, rather than both.  In other words, a polyline will not be filtered if its height or its width exceeds the value of this property.  Whereas with a ShapeSeries, both the height and the width must exceed the value of this property.
    */
    get shapeFilterResolution() {
        return this.i.mg;
    }
    set shapeFilterResolution(v) {
        this.i.mg = +v;
    }
    /**
     * Gets whether or not this series is a shape series
    */
    get isShape() {
        return this.i.c5;
    }
    /**
 * Determine if object can be used as YAxis

* @param axis  * The object to check
*/
    canUseAsYAxis(axis) {
        let iv = this.i.l6(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    canUseAsXAxis(axis) {
        let iv = this.i.l5(axis);
        return (iv);
    }
    /**
     * Raised when tile's image URI should be provided
    */
    get styleShape() {
        return this._styleShape;
    }
    set styleShape(ev) {
        if (this._styleShape_wrapped !== null) {
            this.i.styleShape = delegateRemove(this.i.styleShape, this._styleShape_wrapped);
            this._styleShape_wrapped = null;
            this._styleShape = null;
        }
        this._styleShape = ev;
        this._styleShape_wrapped = (o, e) => {
            let outerArgs = new StyleShapeEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeStyleShape) {
                this.beforeStyleShape(this, outerArgs);
            }
            if (this._styleShape) {
                this._styleShape(this, outerArgs);
            }
        };
        this.i.styleShape = delegateCombine(this.i.styleShape, this._styleShape_wrapped);
    }
}
