()
| 716 | } |
| 717 | |
| 718 | private selectOrigins(): void { |
| 719 | const selection = new SelectionStorage(); |
| 720 | const origins = new Array<GraphNode>(); |
| 721 | let phase = this.phaseName; |
| 722 | for (const node of this.state.selection) { |
| 723 | const origin = node.nodeLabel.origin; |
| 724 | if (origin && origin instanceof NodeOrigin) { |
| 725 | phase = origin.phase; |
| 726 | const node = this.graph.nodeMap[origin.identifier()]; |
| 727 | if (phase === this.phaseName && node) { |
| 728 | origins.push(node); |
| 729 | } else { |
| 730 | selection.adaptNode(origin.identifier()); |
| 731 | } |
| 732 | } |
| 733 | } |
| 734 | // Only go through phase reselection if we actually need |
| 735 | // to display another phase. |
| 736 | if (selection.isAdapted() && phase !== this.phaseName) { |
| 737 | this.showPhaseByName(phase, selection); |
| 738 | } else if (origins.length > 0) { |
| 739 | this.nodeSelectionHandler.clear(); |
| 740 | this.nodeSelectionHandler.select(origins, true, false); |
| 741 | } |
| 742 | } |
| 743 | } |
no test coverage detected