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 SGraphyRectItem = /** @class */ (function (_super) {
    __extends(SGraphyRectItem, _super);
    /**
     * 构造函数
     *
     * @param startX      线的起始x坐标
   * @param startY      线的起始y坐标
   * @param width       矩形的宽度
   * @param height      矩形的宽度
     * @param color       矩形边框的颜色
     * @param fillColor   矩形填充的颜色
     * @param parent
   * @param isVirtual   是否为虚线
     */
    function SGraphyRectItem(parent, startX, startY, width, height, fillColor, color, isVirtual) {
        if (fillColor === void 0) { fillColor = SColor.White; }
        if (color === void 0) { color = SColor.Black; }
        if (isVirtual === void 0) { isVirtual = false; }
        var _this = _super.call(this, parent) || this;
        _this.fillColor = SColor.White;
        _this.color = SColor.Black;
        _this.isVirtual = false;
        _this.startX = startX;
        _this.startY = startY;
        _this.width = width;
        _this.height = height;
        _this.color = color;
        _this.fillColor = fillColor;
        _this.isVirtual = isVirtual;
        return _this;
    } // Constructor()
    /**
     * Item对象边界区域
     *
     * @return SRect
     */
    SGraphyRectItem.prototype.boundingRect = function () {
        return new SRect(this.startX, this.startY, this.width, this.height);
    }; // Function boundingRect()
    /**
     * Item绘制操作
     *
     * @param   painter       painter对象
     * @param   rect          绘制区域
     */
    SGraphyRectItem.prototype.onDraw = function (painter, rect) {
        // painter.pen = new SPen(this.color, this.width);
        painter.pen.color = this.color;
        painter.brush.color = this.fillColor;
        painter.drawRect(this.startX, this.startY, this.width, this.height);
    };
    return SGraphyRectItem;
}(SGraphyItem)); // Class SGraphyRectItem
export default SGraphyRectItem;
