(node: Node<T>, x: number, y: number)
| 477 | } |
| 478 | |
| 479 | protected buildNode(node: Node<T>, x: number, y: number): LayoutNode { |
| 480 | switch (node.type) { |
| 481 | case 'section': |
| 482 | return this.buildSection(node, x, y); |
| 483 | case 'item': |
| 484 | return this.buildItem(node, x, y); |
| 485 | case 'header': |
| 486 | return this.buildSectionHeader(node, x, y); |
| 487 | case 'loader': |
| 488 | return this.buildLoader(node, x, y); |
| 489 | case 'separator': |
| 490 | return this.buildItem(node, x, y); |
| 491 | // uses buildSection instead of buildItem cuz it has a child node (the trigger) |
| 492 | // that need to be processed |
| 493 | case 'submenutrigger': |
| 494 | return this.buildSection(node, x, y); |
| 495 | default: |
| 496 | throw new Error('Unsupported node type: ' + node.type); |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | protected buildLoader(node: Node<T>, x: number, y: number): LayoutNode { |
| 501 | let rect = new Rect(x, y, this.padding, 0); |
no test coverage detected