1 2/** 3 * This file is part of ILIAS, a powerful learning management system 4 * published by ILIAS open source e-Learning e.V. 5 * 6 * ILIAS is licensed with the GPL-3.0, 7 * see https://www.gnu.org/licenses/gpl-3.0.en.html 8 * You should have received a copy of said license along with the 9 * source code, too. 10 * 11 * If this is not the case or you just want to try ILIAS, you'll find 12 * us at: 13 * https://www.ilias.de 14 * https://github.com/ILIAS-eLearning 15 * 16 *********************************************************************/ 17 18import Handle from "./handle.js"; 19import Rect from "./rect.js"; 20import Circle from "./circle.js"; 21import Poly from "./poly.js"; 22 23/** 24 * Shape 25 */ 26export default class ShapeFactory { 27 28 constructor() { 29 } 30 31 /** 32 * @param int x 33 * @param int y 34 * @return Handle 35 */ 36 handle(x, y) { 37 return new Handle(x, y); 38 } 39 40 /** 41 * @param int x1 42 * @param int y1 43 * @param int x2 44 * @param int y2 45 * @return Rect 46 */ 47 rect(x1, y1, x2, y2, data = {}) { 48 return new Rect(this.handle(x1, y1), this.handle(x2, y2), data); 49 } 50 51 rectFromCoordString(coordStr, data = {}) { 52 return new Rect(this.handle(x1, y1), this.handle(x2, y2), data); 53 } 54 55 /** 56 * @param int x1 57 * @param int y1 58 * @param int x2 59 * @param int y2 60 * @return Circle 61 */ 62 circle(x1, y1, x2, y2, data = {}) { 63 return new Circle(this.handle(x1, y1), this.handle(x2, y2), data); 64 } 65 66 /** 67 * @return Poly 68 */ 69 poly(coords, data = {}) { 70 const p = new Poly(data); 71 for (let i=0; i < (coords.length / 2); i++) { 72 p.addHandle(this.handle(coords[i*2], coords[i*2+1])); 73 } 74 return p; 75 } 76 77}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.