OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 "use strict"; | 5 "use strict"; |
6 | 6 |
7 class ScheduleView extends TextView { | 7 class ScheduleView extends TextView { |
8 constructor(id, broker, nodePositionMap) { | 8 constructor(id, broker, nodePositionMap) { |
9 super(id, broker, null, false); | 9 super(id, broker, null, false); |
10 let view = this; | 10 let view = this; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 [/^ +/, null], | 69 [/^ +/, null], |
70 [/^\(deferred\)/, BLOCK_HEADER_STYLE], | 70 [/^\(deferred\)/, BLOCK_HEADER_STYLE], |
71 [/^B\d+/, BLOCK_LINK_STYLE], | 71 [/^B\d+/, BLOCK_LINK_STYLE], |
72 [/^<-/, ARROW_STYLE], | 72 [/^<-/, ARROW_STYLE], |
73 [/^->/, ARROW_STYLE], | 73 [/^->/, ARROW_STYLE], |
74 [/^,/, null], | 74 [/^,/, null], |
75 [/^---/, BLOCK_HEADER_STYLE, -1] | 75 [/^---/, BLOCK_HEADER_STYLE, -1] |
76 ], | 76 ], |
77 // Parse opcode including [] | 77 // Parse opcode including [] |
78 [ | 78 [ |
79 [/^[A-Za-z0-9_]+(\[[^\]]+\])?$/, NODE_STYLE, -1], | 79 [/^[A-Za-z0-9_]+(\[.+])?$/, NODE_STYLE, -1], |
80 [/^[A-Za-z0-9_]+(\[[^\]]+\])?/, NODE_STYLE, 3] | 80 [/^[A-Za-z0-9_]+(\[.+])?/, NODE_STYLE, 3] |
81 ], | 81 ], |
82 // Parse optional parameters | 82 // Parse optional parameters |
83 [ | 83 [ |
84 [/^ /, null, 4], | 84 [/^ /, null, 4], |
85 [/^\(/, null], | 85 [/^\(/, null], |
86 [/^\d+/, ID_LINK_STYLE], | 86 [/^\d+/, ID_LINK_STYLE], |
87 [/^, /, null], | 87 [/^, /, null], |
88 [/^\)$/, null, -1], | 88 [/^\)$/, null, -1], |
89 [/^\)/, null, 4], | 89 [/^\)/, null, 4], |
90 ], | 90 ], |
91 [ | 91 [ |
92 [/^ -> /, ARROW_STYLE, 5], | 92 [/^ -> /, ARROW_STYLE, 5], |
93 [/^.*/, null, -1] | 93 [/^.*/, null, -1] |
94 ], | 94 ], |
95 [ | 95 [ |
96 [/^B\d+$/, BLOCK_LINK_STYLE, -1], | 96 [/^B\d+$/, BLOCK_LINK_STYLE, -1], |
97 [/^B\d+/, BLOCK_LINK_STYLE], | 97 [/^B\d+/, BLOCK_LINK_STYLE], |
98 [/^, /, null] | 98 [/^, /, null] |
99 ], | 99 ], |
100 [ | 100 [ |
101 [/^ -> /, ARROW_STYLE], | 101 [/^ -> /, ARROW_STYLE], |
102 [/^B\d+$/, BLOCK_LINK_STYLE, -1] | 102 [/^B\d+$/, BLOCK_LINK_STYLE, -1] |
103 ] | 103 ] |
104 ]; | 104 ]; |
105 this.setPatterns(patterns); | 105 this.setPatterns(patterns); |
106 this.setNodePositionMap(nodePositionMap); | 106 this.setNodePositionMap(nodePositionMap); |
107 } | 107 } |
| 108 |
| 109 initializeContent(data, rememberedSelection) { |
| 110 super.initializeContent(data, rememberedSelection); |
| 111 var graph = this; |
| 112 var locations = []; |
| 113 for (var id of rememberedSelection) { |
| 114 locations.push({ node_id : id }); |
| 115 } |
| 116 this.selectLocations(locations, true, false); |
| 117 } |
| 118 |
| 119 detachSelection() { |
| 120 var selection = this.selection.detachSelection(); |
| 121 var s = new Set(); |
| 122 for (var i of selection) { |
| 123 s.add(i.location.node_id); |
| 124 }; |
| 125 return s; |
| 126 } |
108 } | 127 } |
OLD | NEW |