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 } from "@sybotan-web/base";
import { SColor } from "@sybotan-web/draw";
/**
 * 圆Item类
 *
 */
var SGraphyCircleItem = /** @class */ (function (_super) {
    __extends(SGraphyCircleItem, _super);
    /**
     * 构造函数
     *
     * @param r          圆半径
     * @param width      圆线的宽度
     * @param color      圆线的颜色
     * @param fillColor  圆填充的颜色
     * @param parent
     */
    function SGraphyCircleItem(parent, r, fillColor, color, width) {
        if (fillColor === void 0) { fillColor = SColor.White; }
        if (color === void 0) { color = SColor.Black; }
        if (width === void 0) { width = 1; }
        var _this = _super.call(this, parent) || this;
        _this.fillColor = SColor.White;
        _this.color = SColor.Black;
        _this.width = 1;
        _this.r = r;
        _this.color = color;
        _this.fillColor = fillColor;
        _this.width = width;
        return _this;
    } // Constructor()
    /**
     * Item对象边界区域
     *
     * @return SRect
     */
    SGraphyCircleItem.prototype.boundingRect = function () {
        return new SRect(-this.r, -this.r, 2 * this.r, 2 * this.r);
    }; // Function boundingRect()
    /**
     * Item绘制操作
     *
     * @param   painter       painter对象
     * @param   rect          绘制区域
     */
    SGraphyCircleItem.prototype.onDraw = function (painter, rect) {
        // painter.pen = new SPen(new SColor("#FF0000"), 22);
        painter.pen.color = this.color;
        painter.brush.color = this.fillColor;
        painter.drawCircle(500, 500, this.r);
    };
    return SGraphyCircleItem;
}(SGraphyItem)); // Class SGraphyCircleItem
export default SGraphyCircleItem;
