UNPKG

@wcardinal/wcardinal-geditor

Version:

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

60 lines 2.09 kB
import { __extends } from "tslib"; import { DCommandBase } from "@wcardinal/wcardinal-ui"; import { EDialogLayerValue } from "../editor/e-dialog-layer-value"; var ECommandLayerChange = /** @class */ (function (_super) { __extends(ECommandLayerChange, _super); function ECommandLayerChange(layer, value, layerContainer) { var _this = _super.call(this) || this; _this._layer = layer; _this._layerContainer = layerContainer; _this._oldValue = EDialogLayerValue.from(layer); _this._newValue = value; return _this; } Object.defineProperty(ECommandLayerChange.prototype, "layer", { get: function () { return this._layer; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandLayerChange.prototype, "newValue", { get: function () { return this._newValue; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandLayerChange.prototype, "oldValue", { get: function () { return this._oldValue; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandLayerChange.prototype, "layerContainer", { get: function () { return this._layerContainer; }, enumerable: false, configurable: true }); ECommandLayerChange.prototype.execute = function () { return this.redo(); }; ECommandLayerChange.prototype.redo = function () { this._newValue.copyTo(this._layer); var layerContainer = this._layerContainer; layerContainer.emit("change", layerContainer); return true; }; ECommandLayerChange.prototype.undo = function () { this._oldValue.copyTo(this._layer); var layerContainer = this._layerContainer; layerContainer.emit("change", layerContainer); return true; }; return ECommandLayerChange; }(DCommandBase)); export { ECommandLayerChange }; //# sourceMappingURL=e-command-layer-change.js.map