UNPKG

@aurigma/design-atoms

Version:

Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.

24 lines 1.27 kB
import { InputHandlerType } from "./InputHandlerType"; import { DefaultInputHandler } from "./Default/DefaultInputHandler"; import { CreateInputHandler } from "./Create/CreateInputHandler"; import { LockedInputHandler } from "./Locked/LockedInputHandler"; import { SelectPixelInputHandler } from "./SelectPixel/SelectPixelInputHandler"; export class InputHandlerFactory { constructor(_viewer, _inputManager) { this._viewer = _viewer; this._inputManager = _inputManager; } create(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); } } } //# sourceMappingURL=InputHandlerFactory.js.map