UNPKG

@wcardinal/wcardinal-geditor

Version:

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

41 lines 1.63 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; import { EShapeButtonLayer } from "./e-shape-button-layer"; var ECommandShapeButtonLayerValueAdd = /** @class */ (function (_super) { __extends(ECommandShapeButtonLayerValueAdd, _super); function ECommandShapeButtonLayerValueAdd(value, selection) { var _this = _super.call(this) || this; _this._selection = selection; _this._value = value; return _this; } ECommandShapeButtonLayerValueAdd.prototype.execute = function () { return this.redo(); }; ECommandShapeButtonLayerValueAdd.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 EShapeButtonLayer) { shape.button.add(value); } } this._selection.update("PROPERTY"); return true; }; ECommandShapeButtonLayerValueAdd.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 EShapeButtonLayer) { shape.button.remove(shape.button.size() - 1); } } this._selection.update("PROPERTY"); return true; }; return ECommandShapeButtonLayerValueAdd; }(DCommandBase)); export { ECommandShapeButtonLayerValueAdd }; //# sourceMappingURL=e-command-shape-button-layer-value-add.js.map