657cbd30a1a6660a2e59fc18d87cebf1.json
7.67 KB
{"ast":null,"code":"/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Component interface\r\n */\n\n/**\r\n * Component interface\r\n * @class\r\n * @param {string} name - component name\r\n * @param {Graphics} graphics - Graphics instance\r\n * @ignore\r\n */\nclass Component {\n constructor(name, graphics) {\n /**\r\n * Component name\r\n * @type {string}\r\n */\n this.name = name;\n /**\r\n * Graphics instance\r\n * @type {Graphics}\r\n */\n\n this.graphics = graphics;\n }\n /**\r\n * Fire Graphics event\r\n * @returns {Object} return value\r\n */\n\n\n fire(...args) {\n const context = this.graphics;\n return this.graphics.fire.apply(context, args);\n }\n /**\r\n * Save image(background) of canvas\r\n * @param {string} name - Name of image\r\n * @param {fabric.Image} oImage - Fabric image instance\r\n */\n\n\n setCanvasImage(name, oImage) {\n this.graphics.setCanvasImage(name, oImage);\n }\n /**\r\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\r\n * @returns {HTMLCanvasElement}\r\n */\n\n\n getCanvasElement() {\n return this.graphics.getCanvasElement();\n }\n /**\r\n * Get fabric.Canvas instance\r\n * @returns {fabric.Canvas}\r\n */\n\n\n getCanvas() {\n return this.graphics.getCanvas();\n }\n /**\r\n * Get canvasImage (fabric.Image instance)\r\n * @returns {fabric.Image}\r\n */\n\n\n getCanvasImage() {\n return this.graphics.getCanvasImage();\n }\n /**\r\n * Get image name\r\n * @returns {string}\r\n */\n\n\n getImageName() {\n return this.graphics.getImageName();\n }\n /**\r\n * Get image editor\r\n * @returns {ImageEditor}\r\n */\n\n\n getEditor() {\n return this.graphics.getEditor();\n }\n /**\r\n * Return component name\r\n * @returns {string}\r\n */\n\n\n getName() {\n return this.name;\n }\n /**\r\n * Set image properties\r\n * @param {Object} setting - Image properties\r\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\r\n */\n\n\n setImageProperties(setting, withRendering) {\n this.graphics.setImageProperties(setting, withRendering);\n }\n /**\r\n * Set canvas dimension - css only\r\n * @param {Object} dimension - Canvas css dimension\r\n */\n\n\n setCanvasCssDimension(dimension) {\n this.graphics.setCanvasCssDimension(dimension);\n }\n /**\r\n * Set canvas dimension - css only\r\n * @param {Object} dimension - Canvas backstore dimension\r\n */\n\n\n setCanvasBackstoreDimension(dimension) {\n this.graphics.setCanvasBackstoreDimension(dimension);\n }\n /**\r\n * Adjust canvas dimension with scaling image\r\n */\n\n\n adjustCanvasDimension() {\n this.graphics.adjustCanvasDimension();\n }\n\n}\n\nexport default Component;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/src/js/interface/component.js"],"names":["Component","constructor","name","graphics","fire","args","context","apply","setCanvasImage","oImage","getCanvasElement","getCanvas","getCanvasImage","getImageName","getEditor","getName","setImageProperties","setting","withRendering","setCanvasCssDimension","dimension","setCanvasBackstoreDimension","adjustCanvasDimension"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,SAAN,CAAgB;AACdC,EAAAA,WAAW,CAACC,IAAD,EAAOC,QAAP,EAAiB;AAC1B;AACJ;AACA;AACA;AACI,SAAKD,IAAL,GAAYA,IAAZ;AAEA;AACJ;AACA;AACA;;AACI,SAAKC,QAAL,GAAgBA,QAAhB;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,IAAI,CAAC,GAAGC,IAAJ,EAAU;AACZ,UAAMC,OAAO,GAAG,KAAKH,QAArB;AAEA,WAAO,KAAKA,QAAL,CAAcC,IAAd,CAAmBG,KAAnB,CAAyBD,OAAzB,EAAkCD,IAAlC,CAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEG,EAAAA,cAAc,CAACN,IAAD,EAAOO,MAAP,EAAe;AAC3B,SAAKN,QAAL,CAAcK,cAAd,CAA6BN,IAA7B,EAAmCO,MAAnC;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,gBAAgB,GAAG;AACjB,WAAO,KAAKP,QAAL,CAAcO,gBAAd,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,SAAS,GAAG;AACV,WAAO,KAAKR,QAAL,CAAcQ,SAAd,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKT,QAAL,CAAcS,cAAd,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,YAAY,GAAG;AACb,WAAO,KAAKV,QAAL,CAAcU,YAAd,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,SAAS,GAAG;AACV,WAAO,KAAKX,QAAL,CAAcW,SAAd,EAAP;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,OAAO,GAAG;AACR,WAAO,KAAKb,IAAZ;AACD;AAED;AACF;AACA;AACA;AACA;;;AACEc,EAAAA,kBAAkB,CAACC,OAAD,EAAUC,aAAV,EAAyB;AACzC,SAAKf,QAAL,CAAca,kBAAd,CAAiCC,OAAjC,EAA0CC,aAA1C;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,qBAAqB,CAACC,SAAD,EAAY;AAC/B,SAAKjB,QAAL,CAAcgB,qBAAd,CAAoCC,SAApC;AACD;AAED;AACF;AACA;AACA;;;AACEC,EAAAA,2BAA2B,CAACD,SAAD,EAAY;AACrC,SAAKjB,QAAL,CAAckB,2BAAd,CAA0CD,SAA1C;AACD;AAED;AACF;AACA;;;AACEE,EAAAA,qBAAqB,GAAG;AACtB,SAAKnB,QAAL,CAAcmB,qBAAd;AACD;;AAhHa;;AAmHhB,eAAetB,SAAf","sourcesContent":["/**\r\n * @author NHN Ent. FE Development Team <dl_javascript@nhn.com>\r\n * @fileoverview Component interface\r\n */\r\n\r\n/**\r\n * Component interface\r\n * @class\r\n * @param {string} name - component name\r\n * @param {Graphics} graphics - Graphics instance\r\n * @ignore\r\n */\r\nclass Component {\r\n constructor(name, graphics) {\r\n /**\r\n * Component name\r\n * @type {string}\r\n */\r\n this.name = name;\r\n\r\n /**\r\n * Graphics instance\r\n * @type {Graphics}\r\n */\r\n this.graphics = graphics;\r\n }\r\n\r\n /**\r\n * Fire Graphics event\r\n * @returns {Object} return value\r\n */\r\n fire(...args) {\r\n const context = this.graphics;\r\n\r\n return this.graphics.fire.apply(context, args);\r\n }\r\n\r\n /**\r\n * Save image(background) of canvas\r\n * @param {string} name - Name of image\r\n * @param {fabric.Image} oImage - Fabric image instance\r\n */\r\n setCanvasImage(name, oImage) {\r\n this.graphics.setCanvasImage(name, oImage);\r\n }\r\n\r\n /**\r\n * Returns canvas element of fabric.Canvas[[lower-canvas]]\r\n * @returns {HTMLCanvasElement}\r\n */\r\n getCanvasElement() {\r\n return this.graphics.getCanvasElement();\r\n }\r\n\r\n /**\r\n * Get fabric.Canvas instance\r\n * @returns {fabric.Canvas}\r\n */\r\n getCanvas() {\r\n return this.graphics.getCanvas();\r\n }\r\n\r\n /**\r\n * Get canvasImage (fabric.Image instance)\r\n * @returns {fabric.Image}\r\n */\r\n getCanvasImage() {\r\n return this.graphics.getCanvasImage();\r\n }\r\n\r\n /**\r\n * Get image name\r\n * @returns {string}\r\n */\r\n getImageName() {\r\n return this.graphics.getImageName();\r\n }\r\n\r\n /**\r\n * Get image editor\r\n * @returns {ImageEditor}\r\n */\r\n getEditor() {\r\n return this.graphics.getEditor();\r\n }\r\n\r\n /**\r\n * Return component name\r\n * @returns {string}\r\n */\r\n getName() {\r\n return this.name;\r\n }\r\n\r\n /**\r\n * Set image properties\r\n * @param {Object} setting - Image properties\r\n * @param {boolean} [withRendering] - If true, The changed image will be reflected in the canvas\r\n */\r\n setImageProperties(setting, withRendering) {\r\n this.graphics.setImageProperties(setting, withRendering);\r\n }\r\n\r\n /**\r\n * Set canvas dimension - css only\r\n * @param {Object} dimension - Canvas css dimension\r\n */\r\n setCanvasCssDimension(dimension) {\r\n this.graphics.setCanvasCssDimension(dimension);\r\n }\r\n\r\n /**\r\n * Set canvas dimension - css only\r\n * @param {Object} dimension - Canvas backstore dimension\r\n */\r\n setCanvasBackstoreDimension(dimension) {\r\n this.graphics.setCanvasBackstoreDimension(dimension);\r\n }\r\n\r\n /**\r\n * Adjust canvas dimension with scaling image\r\n */\r\n adjustCanvasDimension() {\r\n this.graphics.adjustCanvasDimension();\r\n }\r\n}\r\n\r\nexport default Component;\r\n"]},"metadata":{},"sourceType":"module"}