@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
54 lines • 1.77 kB
JavaScript
var EToolGroupImpl = /** @class */ (function () {
function EToolGroupImpl() {
this._isSuspended = false;
this._active = null;
this._activeParameter = null;
}
EToolGroupImpl.prototype.activate = function (target, parameter) {
var oldActive = this._active;
var oldActiveParameter = this._activeParameter;
if (oldActive !== target || oldActiveParameter !== parameter) {
this._activeParameter = parameter;
if (oldActive !== target) {
if (oldActive) {
oldActive.deactivate();
}
this._active = target;
if (!this._isSuspended) {
target.activate();
}
}
}
};
EToolGroupImpl.prototype.deactivate = function (target, parameter) {
if (this._active === target && this._activeParameter === parameter) {
this._active = null;
this._activeParameter = null;
target.deactivate();
}
};
EToolGroupImpl.prototype.suspend = function () {
if (!this._isSuspended) {
this._isSuspended = true;
var active = this._active;
if (active) {
active.deactivate();
}
}
};
EToolGroupImpl.prototype.resume = function () {
if (this._isSuspended) {
this._isSuspended = false;
var active = this._active;
if (active) {
active.activate();
}
}
};
EToolGroupImpl.prototype.isSuspended = function () {
return this._isSuspended;
};
return EToolGroupImpl;
}());
export { EToolGroupImpl };
//# sourceMappingURL=e-tool-group-impl.js.map