@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
50 lines • 1.71 kB
JavaScript
import { __extends } from "tslib";
import { DCommandBase } from "@wcardinal/wcardinal-ui";
var ECommandDocumentCategory = /** @class */ (function (_super) {
__extends(ECommandDocumentCategory, _super);
function ECommandDocumentCategory(diagram, canvas, category) {
var _this = _super.call(this) || this;
_this._diagram = diagram;
_this._canvas = canvas;
_this._category = category;
return _this;
}
Object.defineProperty(ECommandDocumentCategory.prototype, "diagram", {
get: function () {
return this._diagram;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentCategory.prototype, "canvas", {
get: function () {
return this._canvas;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentCategory.prototype, "category", {
get: function () {
return this._category;
},
enumerable: false,
configurable: true
});
ECommandDocumentCategory.prototype.execute = function () {
return this.redo();
};
ECommandDocumentCategory.prototype.redo = function () {
var canvas = this._canvas;
var category = this._category;
this._category = canvas.category;
canvas.category = category;
this._diagram.emit("change", this._diagram);
return true;
};
ECommandDocumentCategory.prototype.undo = function () {
return this.redo();
};
return ECommandDocumentCategory;
}(DCommandBase));
export { ECommandDocumentCategory };
//# sourceMappingURL=e-command-document-category.js.map