var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { SGraphyItem } from '@sybotan-web/graphy';
import { SRect, SPoint } from "@sybotan-web/base";
import { SColor } from "@sybotan-web/draw";
/**
 * 坐标点
 *
 */
var SGraphyPointItem = /** @class */ (function (_super) {
    __extends(SGraphyPointItem, _super);
    /**
     * 构造函数
     *
     * @param r          圆半径
     * @param width      圆线的宽度
     * @param color      圆线的颜色
     * @param fillColor  圆填充的颜色
     * @param parent
     */
    function SGraphyPointItem(parent, width, point, color, fillColor) {
        if (width === void 0) { width = 100; }
        if (point === void 0) { point = new SPoint(0, 0); }
        if (color === void 0) { color = new SColor('#F56C6C'); }
        if (fillColor === void 0) { fillColor = new SColor('#F56C6C'); }
        var _this = _super.call(this, parent) || this;
        _this.width = 100;
        _this.width = width;
        _this.point = point;
        _this.color = color;
        _this.fillColor = fillColor;
        return _this;
    } // Constructor()
    /**
     * Item对象边界区域
     *
     * @return SRect
     */
    SGraphyPointItem.prototype.boundingRect = function () {
        var minX = this.point.x;
        var miny = this.point.y;
        var maxX = this.point.x + this.width;
        var maxY = this.point.y + this.width;
        return new SRect(minX, miny, maxX, maxY);
    }; // Function boundingRect()
    /**
     * Item绘制操作
     *
     * @param   painter       painter对象
     * @param   rect          绘制区域
     */
    SGraphyPointItem.prototype.onDraw = function (painter, rect) {
        painter.pen.color = this.color;
        painter.brush.color = this.fillColor;
        painter.drawRect(this.point.x, this.point.y, this.width, this.width);
    };
    return SGraphyPointItem;
}(SGraphyItem)); // Class SGraphyCircleItem
export default SGraphyPointItem;
