@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
26 lines • 1.42 kB
JavaScript
import { InputHandlerType } from "./InputHandlerType";
import { DefaultInputHandler } from "./Default/DefaultInputHandler";
import { CreateInputHandler } from "./Create/CreateInputHandler";
import { LockedInputHandler } from "./Locked/LockedInputHandler";
import { SelectPixelInputHandler } from "./SelectPixel/SelectPixelInputHandler";
var InputHandlerFactory = /** @class */ (function () {
function InputHandlerFactory(_viewer, _inputManager) {
this._viewer = _viewer;
this._inputManager = _inputManager;
}
InputHandlerFactory.prototype.create = function (type, args) {
switch (type) {
case InputHandlerType.Default:
return new DefaultInputHandler(this._inputManager, this._viewer.canvas, this._viewer.commandManager, this._viewer.eventManager);
case InputHandlerType.Create:
return new CreateInputHandler(args, this._viewer, this._inputManager);
case InputHandlerType.SelectPixel:
return new SelectPixelInputHandler(this._inputManager, this._viewer, this._viewer.canvas.activeTextCanvasHandler);
case InputHandlerType.Locked:
return new LockedInputHandler(this._inputManager, this._viewer.canvas.selection);
}
};
return InputHandlerFactory;
}());
export { InputHandlerFactory };
//# sourceMappingURL=InputHandlerFactory.js.map