UNPKG

@wcardinal/wcardinal-geditor

Version:

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

50 lines 1.62 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; var ECommandDocumentName = /** @class */ (function (_super) { __extends(ECommandDocumentName, _super); function ECommandDocumentName(diagram, canvas, name) { var _this = _super.call(this) || this; _this._diagram = diagram; _this._canvas = canvas; _this._name = name; return _this; } Object.defineProperty(ECommandDocumentName.prototype, "diagram", { get: function () { return this._diagram; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandDocumentName.prototype, "canvas", { get: function () { return this._canvas; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandDocumentName.prototype, "name", { get: function () { return this._name; }, enumerable: false, configurable: true }); ECommandDocumentName.prototype.execute = function () { return this.redo(); }; ECommandDocumentName.prototype.redo = function () { var canvas = this._canvas; var name = this._name; this._name = canvas.name; canvas.name = name; this._diagram.emit("change", this._diagram); return true; }; ECommandDocumentName.prototype.undo = function () { return this.redo(); }; return ECommandDocumentName; }(DCommandBase)); export { ECommandDocumentName }; //# sourceMappingURL=e-command-document-name.js.map