UNPKG

@wcardinal/wcardinal-geditor

Version:

WebGL-based graphic editor, tester and viewer for supervisory systems

41 lines 1.6 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; import { EShapeTable } from "./e-shape-table"; var ECommandShapeTableColumnValueAdd = /** @class */ (function (_super) { __extends(ECommandShapeTableColumnValueAdd, _super); function ECommandShapeTableColumnValueAdd(value, selection) { var _this = _super.call(this) || this; _this._selection = selection; _this._value = value; return _this; } ECommandShapeTableColumnValueAdd.prototype.execute = function () { return this.redo(); }; ECommandShapeTableColumnValueAdd.prototype.redo = function () { var value = this._value; var shapes = this._selection.get(); for (var i = 0, imax = shapes.length; i < imax; ++i) { var shape = shapes[i]; if (shape instanceof EShapeTable) { shape.column.add(value); } } this._selection.update("PROPERTY"); return true; }; ECommandShapeTableColumnValueAdd.prototype.undo = function () { var shapes = this._selection.get(); for (var i = 0, imax = shapes.length; i < imax; ++i) { var shape = shapes[i]; if (shape instanceof EShapeTable) { shape.column.remove(shape.column.size() - 1); } } this._selection.update("PROPERTY"); return true; }; return ECommandShapeTableColumnValueAdd; }(DCommandBase)); export { ECommandShapeTableColumnValueAdd }; //# sourceMappingURL=e-command-shape-table-column-value-add.js.map