@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
49 lines • 1.77 kB
JavaScript
import { __extends } from "tslib";
import { DCommandBase } from "@wcardinal/wcardinal-ui";
var ECommandShapeActionValueAdd = /** @class */ (function (_super) {
__extends(ECommandShapeActionValueAdd, _super);
function ECommandShapeActionValueAdd(value, selection) {
var _this = _super.call(this) || this;
_this._selection = selection;
_this._value = value;
return _this;
}
Object.defineProperty(ECommandShapeActionValueAdd.prototype, "selection", {
get: function () {
return this._selection;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandShapeActionValueAdd.prototype, "value", {
get: function () {
return this._value;
},
enumerable: false,
configurable: true
});
ECommandShapeActionValueAdd.prototype.execute = function () {
return this.redo();
};
ECommandShapeActionValueAdd.prototype.redo = function () {
var value = this._value;
var shapes = this._selection.get();
for (var i = 0, imax = shapes.length; i < imax; ++i) {
shapes[i].action.add(value);
}
this._selection.update("PROPERTY");
return true;
};
ECommandShapeActionValueAdd.prototype.undo = function () {
var shapes = this._selection.get();
for (var i = 0, imax = shapes.length; i < imax; ++i) {
var shape = shapes[i];
shape.action.remove(shape.action.size() - 1);
}
this._selection.update("PROPERTY");
return true;
};
return ECommandShapeActionValueAdd;
}(DCommandBase));
export { ECommandShapeActionValueAdd };
//# sourceMappingURL=e-command-shape-action-value-add.js.map