UNPKG

@wcardinal/wcardinal-geditor

Version:

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

57 lines 1.89 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; var ECommandComposition = /** @class */ (function (_super) { __extends(ECommandComposition, _super); function ECommandComposition(commands, selection) { var _this = _super.call(this) || this; _this._commands = commands; _this._selection = selection; return _this; } Object.defineProperty(ECommandComposition.prototype, "commands", { get: function () { return this._commands; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandComposition.prototype, "selection", { get: function () { return this._selection; }, enumerable: false, configurable: true }); ECommandComposition.prototype.execute = function () { return true; }; ECommandComposition.prototype.redo = function () { var selection = this._selection; var commands = this._commands; selection.lock(); for (var i = 0, imax = commands.length; i < imax; ++i) { commands[i].redo(); } selection.unlock(); return true; }; ECommandComposition.prototype.undo = function () { var selection = this._selection; selection.lock(); var commands = this._commands; for (var i = commands.length - 1; 0 <= i; --i) { commands[i].undo(); } selection.unlock(); return true; }; ECommandComposition.prototype.destroy = function () { var commands = this._commands; for (var i = 0, imax = commands.length; i < imax; ++i) { commands[i].destroy(); } }; return ECommandComposition; }(DCommandBase)); export { ECommandComposition }; //# sourceMappingURL=e-command-composition.js.map