@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
57 lines • 2.02 kB
JavaScript
import { __extends } from "tslib";
import { DBaseStateSetImpl, DCommandBase } from "@wcardinal/wcardinal-ui";
var ECommandDocumentBackground = /** @class */ (function (_super) {
__extends(ECommandDocumentBackground, _super);
function ECommandDocumentBackground(diagram, color, alpha) {
var _this = _super.call(this) || this;
_this._diagram = diagram;
_this._color = color;
_this._alpha = alpha;
return _this;
}
Object.defineProperty(ECommandDocumentBackground.prototype, "diagram", {
get: function () {
return this._diagram;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentBackground.prototype, "color", {
get: function () {
return this._color;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentBackground.prototype, "alpha", {
get: function () {
return this._alpha;
},
enumerable: false,
configurable: true
});
ECommandDocumentBackground.prototype.execute = function () {
return this.redo();
};
ECommandDocumentBackground.prototype.redo = function () {
var canvas = this._diagram.canvas;
if (canvas != null) {
var background = canvas.background;
var color = this._color;
var alpha = this._alpha;
var state = new DBaseStateSetImpl();
this._color = background.getColor(state);
this._alpha = background.getAlpha(state);
background.color = color;
background.alpha = alpha;
this._diagram.emit("change", this._diagram);
}
return true;
};
ECommandDocumentBackground.prototype.undo = function () {
return this.redo();
};
return ECommandDocumentBackground;
}(DCommandBase));
export { ECommandDocumentBackground };
//# sourceMappingURL=e-command-document-background.js.map