author | Claus Gittinger <cg@exept.de> |
Tue, 08 Nov 2011 16:45:00 +0100 | |
changeset 10856 | cb49fbe1a6b7 |
parent 10461 | 8895184eb133 |
child 10869 | b2140b18802d |
permissions | -rw-r--r-- |
9994 | 1 |
" |
10058 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 |
All Rights Reserved |
|
9994 | 4 |
|
10058 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9994 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
NavigatorModel subclass:#VisualProfilerCanvas |
|
31 |
instanceVariableNames:'profilerStatistics selectedMethods packageFilter |
|
32 |
perspectiveSpecHolder callTreeHolder selectedCallTreeItemHolder |
|
33 |
methodList' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
category:'Interface-Browsers-New-Profiler' |
|
37 |
! |
|
38 |
||
39 |
HierarchicalItem subclass:#CallTreeItem |
|
40 |
instanceVariableNames:'subjects' |
|
41 |
classVariableNames:'' |
|
42 |
poolDictionaries:'' |
|
43 |
privateIn:VisualProfilerCanvas |
|
44 |
! |
|
45 |
||
46 |
!VisualProfilerCanvas class methodsFor:'documentation'! |
|
47 |
||
48 |
copyright |
|
49 |
" |
|
10058 | 50 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
51 |
All Rights Reserved |
|
52 |
||
53 |
Permission is hereby granted, free of charge, to any person |
|
54 |
obtaining a copy of this software and associated documentation |
|
55 |
files (the 'Software'), to deal in the Software without |
|
56 |
restriction, including without limitation the rights to use, |
|
57 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
58 |
copies of the Software, and to permit persons to whom the |
|
59 |
Software is furnished to do so, subject to the following |
|
60 |
conditions: |
|
9994 | 61 |
|
10058 | 62 |
The above copyright notice and this permission notice shall be |
63 |
included in all copies or substantial portions of the Software. |
|
64 |
||
65 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
66 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
67 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
68 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
69 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
70 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
71 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
72 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9994 | 73 |
" |
74 |
! ! |
|
75 |
||
76 |
!VisualProfilerCanvas class methodsFor:'interface specs'! |
|
77 |
||
78 |
callTreeSpec |
|
79 |
"This resource specification was automatically generated |
|
80 |
by the UIPainter of ST/X." |
|
81 |
||
82 |
"Do not manually edit this!! If it is corrupted, |
|
83 |
the UIPainter may not be able to read the specification." |
|
84 |
||
85 |
" |
|
86 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#callTreeSpec |
|
87 |
Tools::VisualProfilerCanvas new openInterface:#callTreeSpec |
|
88 |
" |
|
89 |
||
90 |
<resource: #canvas> |
|
91 |
||
92 |
^ |
|
93 |
#(FullSpec |
|
94 |
name: callTreeSpec |
|
95 |
window: |
|
96 |
(WindowSpec |
|
97 |
label: 'Visual Profiler - Call Tree' |
|
98 |
name: 'Visual Profiler - Call Tree' |
|
99 |
min: (Point 10 10) |
|
100 |
bounds: (Rectangle 0 0 300 300) |
|
101 |
) |
|
102 |
component: |
|
103 |
(SpecCollection |
|
104 |
collection: ( |
|
105 |
(HierarchicalListViewSpec |
|
106 |
name: 'CallTree' |
|
107 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
108 |
model: selectedCallTreeItemHolder |
|
109 |
hasHorizontalScrollBar: true |
|
110 |
hasVerticalScrollBar: true |
|
111 |
listModel: callTreeHolder |
|
112 |
useIndex: false |
|
113 |
highlightMode: line |
|
114 |
useDefaultIcons: false |
|
115 |
) |
|
116 |
) |
|
117 |
||
118 |
) |
|
119 |
) |
|
120 |
||
121 |
"Modified: / 10-10-2007 / 08:51:10 / janfrog" |
|
122 |
! |
|
123 |
||
124 |
methodListSpec |
|
125 |
"This resource specification was automatically generated |
|
126 |
by the UIPainter of ST/X." |
|
127 |
||
128 |
"Do not manually edit this!! If it is corrupted, |
|
129 |
the UIPainter may not be able to read the specification." |
|
130 |
||
131 |
" |
|
132 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#methodListSpec |
|
133 |
Tools::VisualProfilerCanvas new openInterface:#methodListSpec |
|
134 |
" |
|
135 |
||
136 |
<resource: #canvas> |
|
137 |
||
138 |
^ |
|
139 |
#(FullSpec |
|
140 |
name: methodListSpec |
|
141 |
window: |
|
142 |
(WindowSpec |
|
143 |
label: 'Method list' |
|
144 |
name: 'Method list' |
|
145 |
min: (Point 10 10) |
|
146 |
bounds: (Rectangle 0 0 300 300) |
|
147 |
) |
|
148 |
component: |
|
149 |
(SpecCollection |
|
150 |
collection: ( |
|
151 |
(DataSetSpec |
|
152 |
name: 'MethodList' |
|
153 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
154 |
model: selectedCallTreeItemHolder |
|
155 |
hasHorizontalScrollBar: true |
|
156 |
hasVerticalScrollBar: true |
|
157 |
dataList: methodListAspect |
|
158 |
useIndex: false |
|
159 |
columnHolder: methodListColumns |
|
160 |
) |
|
161 |
) |
|
162 |
||
163 |
) |
|
164 |
) |
|
165 |
||
166 |
"Modified: / 01-12-2007 / 23:57:41 / janfrog" |
|
167 |
! |
|
168 |
||
169 |
sidebarInfoSpec |
|
170 |
"This resource specification was automatically generated |
|
171 |
by the UIPainter of ST/X." |
|
172 |
||
173 |
"Do not manually edit this!! If it is corrupted, |
|
174 |
the UIPainter may not be able to read the specification." |
|
175 |
||
176 |
" |
|
177 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#sidebarInfoSpec |
|
178 |
Tools::VisualProfilerCanvas new openInterface:#sidebarInfoSpec |
|
179 |
" |
|
180 |
||
181 |
<resource: #canvas> |
|
182 |
||
183 |
^ |
|
184 |
#(FullSpec |
|
185 |
name: sidebarInfoSpec |
|
186 |
window: |
|
187 |
(WindowSpec |
|
188 |
label: 'General Info' |
|
189 |
name: 'General Info' |
|
190 |
min: (Point 10 10) |
|
191 |
bounds: (Rectangle 0 0 300 300) |
|
192 |
) |
|
193 |
component: |
|
194 |
(SpecCollection |
|
195 |
collection: ( |
|
196 |
(VerticalPanelViewSpec |
|
197 |
name: 'Panel' |
|
198 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
199 |
horizontalLayout: fit |
|
200 |
verticalLayout: topFit |
|
201 |
horizontalSpace: 3 |
|
202 |
verticalSpace: 3 |
|
203 |
component: |
|
204 |
(SpecCollection |
|
205 |
collection: ( |
|
206 |
(TransparentBoxSpec |
|
207 |
name: 'StartTimeBox' |
|
208 |
component: |
|
209 |
(SpecCollection |
|
210 |
collection: ( |
|
211 |
(LabelSpec |
|
212 |
label: 'Start time:' |
|
213 |
name: 'StartTimestampLabel' |
|
214 |
layout: (LayoutFrame 0 0 0 0 0 1 0 0.5) |
|
215 |
translateLabel: true |
|
216 |
adjust: left |
|
217 |
) |
|
218 |
(LabelSpec |
|
219 |
name: 'StartTimestamp' |
|
220 |
layout: (LayoutFrame 30 0 0 0.5 0 1 0 1) |
|
221 |
translateLabel: true |
|
222 |
labelChannel: startTimestampAspect |
|
223 |
adjust: left |
|
224 |
) |
|
225 |
) |
|
226 |
||
227 |
) |
|
228 |
extent: (Point 300 50) |
|
229 |
) |
|
230 |
(TransparentBoxSpec |
|
231 |
name: 'ExecutionTimeBox' |
|
232 |
component: |
|
233 |
(SpecCollection |
|
234 |
collection: ( |
|
235 |
(LabelSpec |
|
236 |
label: 'Execution time:' |
|
237 |
name: 'ExecutionTimeLabel' |
|
238 |
layout: (LayoutFrame 0 0 0 0 0 1 0 0.5) |
|
239 |
translateLabel: true |
|
240 |
adjust: left |
|
241 |
) |
|
242 |
(LabelSpec |
|
243 |
label: 'Label' |
|
244 |
name: 'ExecutionTime' |
|
245 |
layout: (LayoutFrame 30 0 0 0.5 0 1 0 1) |
|
246 |
translateLabel: true |
|
247 |
labelChannel: executionTimeAspect |
|
248 |
adjust: left |
|
249 |
) |
|
250 |
) |
|
251 |
||
252 |
) |
|
253 |
extent: (Point 300 50) |
|
254 |
) |
|
255 |
(TransparentBoxSpec |
|
256 |
name: 'NotesBox' |
|
257 |
component: |
|
258 |
(SpecCollection |
|
259 |
collection: ( |
|
260 |
(LabelSpec |
|
261 |
label: 'Notes:' |
|
262 |
name: 'NotesLabel' |
|
263 |
layout: (LayoutFrame 0 0 0 0 0 1 25 0) |
|
264 |
translateLabel: true |
|
265 |
adjust: left |
|
266 |
) |
|
267 |
(TextEditorSpec |
|
268 |
name: 'Notes' |
|
269 |
layout: (LayoutFrame 30 0 25 0 0 1 0 1) |
|
270 |
model: notesAspect |
|
271 |
hasHorizontalScrollBar: true |
|
272 |
hasVerticalScrollBar: true |
|
273 |
) |
|
274 |
) |
|
275 |
||
276 |
) |
|
277 |
extent: (Point 300 194) |
|
278 |
) |
|
279 |
) |
|
280 |
||
281 |
) |
|
282 |
) |
|
283 |
) |
|
284 |
||
285 |
) |
|
286 |
) |
|
287 |
||
288 |
"Modified: / 24-11-2007 / 09:27:08 / janfrog" |
|
289 |
! |
|
290 |
||
291 |
sidebarPackageFilterSpec |
|
292 |
<resource: #canvas> |
|
293 |
"This resource specification was automatically generated |
|
294 |
by the UIPainter of ST/X." |
|
295 |
"Do not manually edit this!! If it is corrupted, |
|
296 |
the UIPainter may not be able to read the specification." |
|
297 |
" |
|
298 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#packageFilterSpec |
|
299 |
Tools::VisualProfilerCanvas new openInterface:#packageFilterSpec" |
|
300 |
||
301 |
^ #( #FullSpec |
|
302 |
#name: #sidebarPackageFilterSpec |
|
303 |
#window: |
|
304 |
#(WindowSpec label: 'Package Filter' name: 'Package Filter' min: (Point 10 10) bounds: (Rectangle 0 0 300 300)) |
|
305 |
#component: |
|
306 |
#(SpecCollection collection: ((SubCanvasSpec name: 'PackageFilterCanvas' layout: (LayoutFrame 0 0 0 0 0 1 0 1) hasHorizontalScrollBar: false hasVerticalScrollBar: false majorKey: #'Tools::HierarchicalPackageFilterList' minorKey: windowSpec subAspectHolders: (Array (SubChannelInfoSpec subAspect: packageFilter aspect: packageFilter)) createNewApplication: true createNewBuilder: true))) ) |
|
307 |
||
308 |
"Modified: / 24-11-2007 / 08:34:31 / janfrog" |
|
309 |
! |
|
310 |
||
311 |
sidebarSpec |
|
312 |
"This resource specification was automatically generated |
|
313 |
by the UIPainter of ST/X." |
|
314 |
||
315 |
"Do not manually edit this!! If it is corrupted, |
|
316 |
the UIPainter may not be able to read the specification." |
|
317 |
||
318 |
" |
|
319 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#sidebarSpec |
|
320 |
Tools::VisualProfilerCanvas new openInterface:#sidebarSpec |
|
321 |
" |
|
322 |
||
323 |
<resource: #canvas> |
|
324 |
||
325 |
^ |
|
326 |
#(FullSpec |
|
327 |
name: sidebarSpec |
|
328 |
window: |
|
329 |
(WindowSpec |
|
330 |
label: 'Profiler Sidebar' |
|
331 |
name: 'Profiler Sidebar' |
|
332 |
min: (Point 10 10) |
|
333 |
bounds: (Rectangle 0 0 300 300) |
|
334 |
) |
|
335 |
component: |
|
336 |
(SpecCollection |
|
337 |
collection: ( |
|
338 |
(MenuPanelSpec |
|
339 |
name: 'ToolBar' |
|
340 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
341 |
menu: sidebarMenu |
|
342 |
textDefault: true |
|
343 |
) |
|
344 |
(NoteBookViewSpec |
|
345 |
name: 'SidebarNotebook' |
|
346 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
347 |
menu: sidebarNotebookTabList |
|
348 |
direction: left |
|
349 |
fitLastRow: false |
|
350 |
) |
|
351 |
) |
|
352 |
||
353 |
) |
|
354 |
) |
|
355 |
||
356 |
"Modified: / 24-11-2007 / 09:13:40 / janfrog" |
|
357 |
! |
|
358 |
||
359 |
windowSpec |
|
360 |
"This resource specification was automatically generated |
|
361 |
by the UIPainter of ST/X." |
|
362 |
||
363 |
"Do not manually edit this!! If it is corrupted, |
|
364 |
the UIPainter may not be able to read the specification." |
|
365 |
||
366 |
" |
|
367 |
UIPainter new openOnClass:Tools::VisualProfilerCanvas andSelector:#windowSpec |
|
368 |
Tools::VisualProfilerCanvas new openInterface:#windowSpec |
|
369 |
Tools::VisualProfilerCanvas open |
|
370 |
" |
|
371 |
||
372 |
<resource: #canvas> |
|
373 |
||
374 |
^ |
|
375 |
#(FullSpec |
|
376 |
name: windowSpec |
|
377 |
window: |
|
378 |
(WindowSpec |
|
379 |
label: 'Visual Profiler' |
|
380 |
name: 'Visual Profiler' |
|
381 |
min: (Point 10 10) |
|
382 |
bounds: (Rectangle 0 0 714 332) |
|
383 |
) |
|
384 |
component: |
|
385 |
(SpecCollection |
|
386 |
collection: ( |
|
387 |
(VariableHorizontalPanelSpec |
|
388 |
name: 'SidebarAndPerspectivePanel' |
|
389 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
390 |
showHandle: true |
|
391 |
snapMode: both |
|
392 |
component: |
|
393 |
(SpecCollection |
|
394 |
collection: ( |
|
395 |
(UISubSpecification |
|
396 |
name: 'SidebarSpec' |
|
397 |
minorKey: sidebarSpec |
|
398 |
) |
|
399 |
(NoteBookViewSpec |
|
400 |
name: 'PerspectiveNoteBook' |
|
401 |
menu: perspectiveNotebookTabList |
|
402 |
direction: bottom |
|
403 |
fitLastRow: false |
|
404 |
) |
|
405 |
) |
|
406 |
||
407 |
) |
|
408 |
handles: (Any 0.3 1.0) |
|
409 |
) |
|
410 |
) |
|
411 |
||
412 |
) |
|
413 |
) |
|
414 |
||
415 |
"Modified: / 24-11-2007 / 09:07:56 / janfrog" |
|
416 |
! ! |
|
417 |
||
418 |
!VisualProfilerCanvas class methodsFor:'list specs'! |
|
419 |
||
420 |
perspectiveNotebookTabList |
|
421 |
"This resource specification was automatically generated |
|
422 |
by the TabListEditor of ST/X." |
|
423 |
||
424 |
"Do not manually edit this!! If it is corrupted, |
|
425 |
the TabListEditor may not be able to read the specification." |
|
426 |
||
427 |
" |
|
428 |
TabListEditor new openOnClass: self andSelector:#perspectiveNotebookTabList |
|
429 |
" |
|
430 |
||
431 |
<resource: #tabList> |
|
432 |
||
433 |
^ #( |
|
434 |
(TabItem |
|
435 |
label: 'Call tree' |
|
436 |
createNewBuilder: false |
|
437 |
minorKey: callTreeSpec |
|
438 |
) |
|
439 |
(TabItem |
|
440 |
label: 'Method list' |
|
441 |
createNewBuilder: false |
|
442 |
minorKey: methodListSpec |
|
443 |
) |
|
444 |
) |
|
445 |
||
446 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
447 |
||
448 |
"Modified: / 02-12-2007 / 00:03:42 / janfrog" |
|
449 |
! |
|
450 |
||
451 |
sidebarNotebookTabList |
|
452 |
"This resource specification was automatically generated |
|
453 |
by the TabListEditor of ST/X." |
|
454 |
||
455 |
"Do not manually edit this!! If it is corrupted, |
|
456 |
the TabListEditor may not be able to read the specification." |
|
457 |
||
458 |
" |
|
459 |
TabListEditor new openOnClass: self andSelector:#sidebarNotebookTabList |
|
460 |
" |
|
461 |
||
462 |
<resource: #tabList> |
|
463 |
||
464 |
^ #( |
|
465 |
(TabItem |
|
466 |
label: 'Statistics' |
|
467 |
minorKey: sidebarInfoSpec |
|
468 |
) |
|
469 |
(TabItem |
|
470 |
label: 'Packages' |
|
471 |
createNewBuilder: false |
|
472 |
minorKey: sidebarPackageFilterSpec |
|
473 |
) |
|
474 |
) |
|
475 |
||
476 |
collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] |
|
477 |
||
478 |
"Modified: / 24-11-2007 / 08:45:36 / janfrog" |
|
479 |
! ! |
|
480 |
||
481 |
!VisualProfilerCanvas class methodsFor:'menu specs'! |
|
482 |
||
483 |
sidebarMenu |
|
484 |
"This resource specification was automatically generated |
|
485 |
by the MenuEditor of ST/X." |
|
486 |
||
487 |
"Do not manually edit this!! If it is corrupted, |
|
488 |
the MenuEditor may not be able to read the specification." |
|
489 |
||
490 |
" |
|
491 |
MenuEditor new openOnClass:Tools::VisualProfilerCanvas andSelector:#sidebarMenu |
|
492 |
(Menu new fromLiteralArrayEncoding:(Tools::VisualProfilerCanvas sidebarMenu)) startUp |
|
493 |
" |
|
494 |
||
495 |
<resource: #menu> |
|
496 |
||
497 |
^ |
|
498 |
#(Menu |
|
499 |
( |
|
500 |
(MenuItem |
|
501 |
label: 'Save' |
|
502 |
itemValue: saveProfilerAction |
|
503 |
translateLabel: true |
|
10856 | 504 |
labelImage: (ResourceRetriever ToolbarIconLibrary saveToFileIcon) |
9994 | 505 |
) |
506 |
) |
|
507 |
nil |
|
508 |
nil |
|
509 |
) |
|
510 |
||
511 |
"Modified: / 24-11-2007 / 09:10:50 / janfrog" |
|
10856 | 512 |
"Modified: / 08-11-2011 / 16:42:53 / cg" |
9994 | 513 |
! ! |
514 |
||
515 |
!VisualProfilerCanvas class methodsFor:'plugIn spec'! |
|
516 |
||
517 |
aspectSelectors |
|
518 |
"This resource specification was automatically generated |
|
519 |
by the UIPainter of ST/X." |
|
520 |
||
521 |
"Do not manually edit this. If it is corrupted, |
|
522 |
the UIPainter may not be able to read the specification." |
|
523 |
||
524 |
"Return a description of exported aspects; |
|
525 |
these can be connected to aspects of an embedding application |
|
526 |
(if this app is embedded in a subCanvas)." |
|
527 |
||
528 |
^ #( |
|
529 |
#packageFilter |
|
530 |
#profilerStatistics |
|
531 |
#selectedMethods |
|
532 |
). |
|
533 |
||
534 |
"Modified: / 01-12-2007 / 23:57:41 / janfrog" |
|
535 |
! ! |
|
536 |
||
537 |
!VisualProfilerCanvas class methodsFor:'tableColumns specs'! |
|
538 |
||
539 |
methodListColumns |
|
540 |
"This resource specification was automatically generated |
|
541 |
by the DataSetBuilder of ST/X." |
|
542 |
||
543 |
"Do not manually edit this!! If it is corrupted, |
|
544 |
the DataSetBuilder may not be able to read the specification." |
|
545 |
||
546 |
" |
|
547 |
DataSetBuilder new openOnClass:Tools::VisualProfilerCanvas andSelector:#methodListColumns |
|
548 |
" |
|
549 |
||
550 |
<resource: #tableColumns> |
|
551 |
||
552 |
^#( |
|
553 |
(DataSetColumnSpec |
|
554 |
labelButtonType: Button |
|
555 |
rendererType: rowSelector |
|
556 |
showRowSeparator: false |
|
557 |
showSelectionHighLighted: false |
|
558 |
showColSeparator: false |
|
559 |
) |
|
560 |
(DataSetColumnSpec |
|
561 |
label: 'Tally' |
|
562 |
labelButtonType: Button |
|
563 |
type: number |
|
564 |
model: tally |
|
565 |
canSelect: false |
|
566 |
showRowSeparator: false |
|
567 |
showSelectionHighLighted: false |
|
568 |
showColSeparator: false |
|
569 |
) |
|
570 |
(DataSetColumnSpec |
|
571 |
label: 'Method' |
|
572 |
labelButtonType: Button |
|
573 |
model: methodLabel |
|
574 |
canSelect: false |
|
575 |
showRowSeparator: false |
|
576 |
showSelectionHighLighted: false |
|
577 |
showColSeparator: false |
|
578 |
) |
|
579 |
(DataSetColumnSpec |
|
580 |
label: 'Package' |
|
581 |
labelButtonType: Button |
|
582 |
model: packageLabel |
|
583 |
canSelect: false |
|
584 |
showRowSeparator: false |
|
585 |
showSelectionHighLighted: false |
|
586 |
showColSeparator: false |
|
587 |
) |
|
588 |
) |
|
589 |
||
590 |
"Modified: / 01-12-2007 / 23:56:15 / janfrog" |
|
591 |
! ! |
|
592 |
||
593 |
!VisualProfilerCanvas methodsFor:'aspects'! |
|
594 |
||
595 |
callTreeHolder |
|
596 |
"automatically generated by UIPainter ..." |
|
597 |
||
598 |
"*** the code below creates a default model when invoked." |
|
599 |
"*** (which may not be the one you wanted)" |
|
600 |
"*** Please change as required and accept it in the browser." |
|
601 |
"*** (and replace this comment by something more useful ;-)" |
|
602 |
||
603 |
callTreeHolder isNil ifTrue:[ |
|
604 |
callTreeHolder := HierarchicalList new. |
|
605 |
callTreeHolder application: self. |
|
606 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
607 |
"/ callTreeHolder addDependent:self. |
|
608 |
"/ callTreeHolder onChangeSend:#callTreeHolderChanged to:self. |
|
609 |
]. |
|
610 |
^ callTreeHolder. |
|
611 |
||
612 |
"Created: / 10-10-2007 / 08:34:26 / janfrog" |
|
613 |
"Modified: / 10-10-2007 / 12:48:20 / janfrog" |
|
614 |
! |
|
615 |
||
616 |
executionTimeAspect |
|
617 |
||
618 |
^(PluggableAdaptor on: profilerStatistics) |
|
619 |
getBlock:[:model| |
|
620 |
model value |
|
621 |
ifNil:['N/A'] |
|
622 |
ifNotNil:[model value computationTime printString |
|
623 |
, 'ms' |
|
624 |
,' (', (TimeDuration new setMilliseconds:model value computationTime) printString , ')']] |
|
625 |
putBlock:[:ign1 :ign2|self shouldNeverBeReached] |
|
626 |
updateBlock:[:ign1 :ign2 :ign3|true] |
|
627 |
||
628 |
"Created: / 24-11-2007 / 08:44:49 / janfrog" |
|
629 |
! |
|
630 |
||
631 |
methodListAspect |
|
632 |
||
633 |
methodList ifNil:[methodList := List new]. |
|
634 |
^methodList |
|
635 |
||
636 |
"Created: / 01-12-2007 / 23:38:16 / janfrog" |
|
637 |
! |
|
638 |
||
639 |
notesAspect |
|
640 |
||
641 |
^(AspectAdaptor forAspect:#notes) |
|
642 |
subjectChannel: self profilerStatistics |
|
643 |
||
644 |
"Created: / 24-11-2007 / 09:27:47 / janfrog" |
|
645 |
! |
|
646 |
||
647 |
packageFilter |
|
648 |
"return/create the 'packageFilter' value holder (automatically generated)" |
|
649 |
||
650 |
packageFilter isNil ifTrue:[ |
|
651 |
packageFilter := ValueHolder new. |
|
652 |
]. |
|
653 |
^ packageFilter |
|
654 |
||
655 |
"Created: / 09-10-2007 / 21:27:32 / janfrog" |
|
656 |
! |
|
657 |
||
658 |
packageFilter:something |
|
659 |
"set the 'packageFilter' value holder (automatically generated)" |
|
660 |
||
661 |
packageFilter ifNotNil:[packageFilter removeDependent: self]. |
|
662 |
packageFilter := something. |
|
663 |
packageFilter ifNotNil:[packageFilter addDependent: self]. |
|
664 |
||
665 |
"Created: / 09-10-2007 / 21:27:32 / janfrog" |
|
666 |
"Modified: / 10-10-2007 / 12:47:08 / janfrog" |
|
667 |
! |
|
668 |
||
669 |
perspectiveNotebookTabList |
|
670 |
"Generated by the TabListEditor" |
|
671 |
||
672 |
|list| |
|
673 |
||
674 |
(list := builder bindingAt:#perspectiveNotebookTabList) isNil ifTrue:[ |
|
675 |
builder aspectAt:#perspectiveNotebookTabList put:(list := self class perspectiveNotebookTabList). |
|
676 |
]. |
|
677 |
^ list |
|
678 |
||
679 |
"Created: / 10-10-2007 / 10:10:07 / janfrog" |
|
680 |
! |
|
681 |
||
682 |
perspectiveSpecHolder |
|
683 |
"automatically generated by UIPainter ..." |
|
684 |
||
685 |
"*** the code below creates a default model when invoked." |
|
686 |
"*** (which may not be the one you wanted)" |
|
687 |
"*** Please change as required and accept it in the browser." |
|
688 |
"*** (and replace this comment by something more useful ;-)" |
|
689 |
||
690 |
perspectiveSpecHolder isNil ifTrue:[ |
|
691 |
perspectiveSpecHolder := #callTreeSpec asValue. |
|
692 |
"/ if your app needs to be notified of changes, uncomment one of the lines below: |
|
693 |
"/ perspectiveSpecHolder addDependent:self. |
|
694 |
"/ perspectiveSpecHolder onChangeSend:#perspectiveSpecHolderChanged to:self. |
|
695 |
]. |
|
696 |
^ perspectiveSpecHolder. |
|
697 |
||
698 |
"Created: / 10-10-2007 / 08:31:35 / janfrog" |
|
699 |
! |
|
700 |
||
701 |
profilerStatistics |
|
702 |
"return/create the 'profilerStatistics' value holder (automatically generated)" |
|
703 |
||
704 |
profilerStatistics isNil ifTrue:[ |
|
705 |
profilerStatistics := ValueHolder new. |
|
706 |
]. |
|
707 |
^ profilerStatistics |
|
708 |
||
709 |
"Created: / 09-10-2007 / 21:53:38 / janfrog" |
|
710 |
! |
|
711 |
||
712 |
profilerStatistics:something |
|
713 |
"set the 'profilerStatistics' value holder (automatically generated)" |
|
714 |
||
715 |
profilerStatistics ifNotNil:[profilerStatistics removeDependent: self]. |
|
716 |
profilerStatistics := something. |
|
717 |
profilerStatistics ifNotNil:[profilerStatistics addDependent: self]. |
|
718 |
||
719 |
"Created: / 09-10-2007 / 21:53:38 / janfrog" |
|
720 |
"Modified: / 10-10-2007 / 08:46:46 / janfrog" |
|
721 |
! |
|
722 |
||
723 |
selectedCallTreeItemHolder |
|
724 |
"automatically generated by UIPainter ..." |
|
725 |
||
726 |
"*** the code below creates a default model when invoked." |
|
727 |
"*** (which may not be the one you wanted)" |
|
728 |
"*** Please change as required and accept it in the browser." |
|
729 |
"*** (and replace this comment by something more useful ;-)" |
|
730 |
||
731 |
selectedCallTreeItemHolder isNil ifTrue:[ |
|
732 |
selectedCallTreeItemHolder := ValueHolder new. |
|
733 |
selectedCallTreeItemHolder onChangeSend:#selectedCallTreeItemChanged to:self. |
|
734 |
]. |
|
735 |
^ selectedCallTreeItemHolder. |
|
736 |
||
737 |
"Created: / 10-10-2007 / 08:51:34 / janfrog" |
|
738 |
! |
|
739 |
||
740 |
selectedMethods |
|
741 |
"return/create the 'selectedMethods' value holder (automatically generated)" |
|
742 |
||
743 |
selectedMethods isNil ifTrue:[ |
|
744 |
selectedMethods := ValueHolder new. |
|
745 |
]. |
|
746 |
^ selectedMethods |
|
747 |
||
748 |
"Created: / 09-10-2007 / 21:18:18 / janfrog" |
|
749 |
! |
|
750 |
||
751 |
selectedMethods:something |
|
752 |
"set the 'selectedMethods' value holder (automatically generated)" |
|
753 |
||
754 |
selectedMethods := something. |
|
755 |
||
756 |
"Created: / 09-10-2007 / 21:18:18 / janfrog" |
|
757 |
! |
|
758 |
||
759 |
sidebarNotebookTabList |
|
760 |
"Generated by the TabListEditor" |
|
761 |
||
762 |
|list| |
|
763 |
||
764 |
(list := builder bindingAt:#sidebarNotebookTabList) isNil ifTrue:[ |
|
765 |
builder aspectAt:#sidebarNotebookTabList put:(list := self class sidebarNotebookTabList). |
|
766 |
]. |
|
767 |
^ list |
|
768 |
||
769 |
"Created: / 10-10-2007 / 10:10:35 / janfrog" |
|
770 |
! |
|
771 |
||
772 |
startTimestampAspect |
|
773 |
||
774 |
^(PluggableAdaptor on: profilerStatistics) |
|
775 |
getBlock:[:model| |
|
776 |
model value |
|
777 |
ifNil:['N/A'] |
|
778 |
ifNotNil:[model value startTimestamp printString]] |
|
779 |
putBlock:[:ign1 :ign2|self shouldNeverBeReached] |
|
780 |
updateBlock:[:ign1 :ign2 :ign3|true] |
|
781 |
||
782 |
"Created: / 24-11-2007 / 08:57:58 / janfrog" |
|
783 |
! ! |
|
784 |
||
785 |
!VisualProfilerCanvas methodsFor:'change & update'! |
|
786 |
||
787 |
methodsSelectionChanged |
|
788 |
||
789 |
self topApplication == self |
|
790 |
ifFalse:[self topApplication methodsSelectionChanged] |
|
791 |
||
792 |
"Created: / 09-10-2007 / 21:33:50 / janfrog" |
|
793 |
! |
|
794 |
||
795 |
selectedCallTreeItemChanged |
|
796 |
||
797 |
self selectedCallTreeItemHolder value ifNil:[^self]. |
|
798 |
self switchToMethod: self selectedCallTreeItemHolder value method |
|
799 |
||
800 |
"Created: / 10-10-2007 / 08:52:33 / janfrog" |
|
801 |
! |
|
802 |
||
803 |
update: aspect with: value from: sender |
|
804 |
||
805 |
sender == self profilerStatistics |
|
806 |
ifTrue:[^self updateCallTreeRoot; updateMethodList]. |
|
807 |
||
808 |
sender == self packageFilter |
|
809 |
ifTrue:[self updateCallTree; updateMethodList] |
|
810 |
||
811 |
"Created: / 10-10-2007 / 08:46:59 / janfrog" |
|
812 |
"Modified: / 01-12-2007 / 23:52:07 / janfrog" |
|
813 |
! |
|
814 |
||
815 |
updateCallTree |
|
816 |
||
817 |
self callTreeHolder root updateChildren |
|
818 |
||
819 |
"Created: / 10-10-2007 / 12:57:36 / janfrog" |
|
820 |
! |
|
821 |
||
822 |
updateCallTreeRoot |
|
823 |
||
824 |
| callTree callTreeRootItem | |
|
825 |
callTree := self callTreeHolder. |
|
826 |
profilerStatistics value ifNil:[^callTree root: nil]. |
|
827 |
callTreeRootItem := CallTreeItem |
|
828 |
subject: profilerStatistics value tree |
|
829 |
parent: callTree. |
|
830 |
callTree root: callTreeRootItem. |
|
831 |
callTree showRoot: true. |
|
832 |
||
833 |
"Created: / 10-10-2007 / 12:59:07 / janfrog" |
|
834 |
! |
|
835 |
||
836 |
updateMethodList |
|
837 |
||
838 |
| items | |
|
839 |
self methodListAspect removeAll. |
|
840 |
self profilerStatistics value ifNil:[^self]. |
|
841 |
items := ProfilerInfoBuilder::MethodList new |
|
842 |
packages: self packageFilter value; |
|
843 |
build: self profilerStatistics value tree; |
|
844 |
items. |
|
845 |
||
846 |
self methodListAspect addAll: items |
|
847 |
||
848 |
"Created: / 01-12-2007 / 23:39:15 / janfrog" |
|
849 |
! ! |
|
850 |
||
851 |
!VisualProfilerCanvas methodsFor:'hooks'! |
|
852 |
||
853 |
commonPostBuild |
|
854 |
||
855 |
super commonPostBuild. |
|
856 |
self updateCallTreeRoot. |
|
857 |
self updateMethodList. |
|
858 |
||
859 |
"Created: / 09-10-2007 / 20:05:18 / janfrog" |
|
860 |
"Modified: / 01-12-2007 / 23:39:34 / janfrog" |
|
861 |
! |
|
862 |
||
863 |
postBuildEditModeInfoLabel: view |
|
864 |
||
865 |
"Created: / 09-10-2007 / 21:06:35 / janfrog" |
|
866 |
! |
|
867 |
||
868 |
postBuildEditorNoteBook: view |
|
869 |
||
870 |
"Created: / 09-10-2007 / 21:05:39 / janfrog" |
|
871 |
! ! |
|
872 |
||
873 |
!VisualProfilerCanvas methodsFor:'user actions'! |
|
874 |
||
875 |
switchToMethod: aMethod |
|
876 |
||
877 |
self selectedMethods value:(Array with: aMethod). |
|
878 |
self methodsSelectionChanged |
|
879 |
||
880 |
"Created: / 09-10-2007 / 21:36:35 / janfrog" |
|
881 |
! ! |
|
882 |
||
883 |
!VisualProfilerCanvas methodsFor:'user actions-profiler'! |
|
884 |
||
885 |
profilerTestAction |
|
886 |
||
887 |
self switchToMethod:(Object >> #yourself). |
|
888 |
||
889 |
"Created: / 09-10-2007 / 21:07:53 / janfrog" |
|
890 |
! |
|
891 |
||
892 |
saveProfilerAction |
|
893 |
||
894 |
| file profiler | |
|
895 |
file := Dialog requestFileName:'Select file' pattern:'*.profiler.boss'. |
|
10461
8895184eb133
changed: #saveProfilerAction
Claus Gittinger <cg@exept.de>
parents:
10058
diff
changeset
|
896 |
file isEmptyOrNil ifTrue:[^self]. |
9994 | 897 |
profiler := self profilerStatistics value. |
898 |
profiler storeStatisticsOn: file asFilename writeStream |
|
899 |
||
900 |
"Created: / 24-11-2007 / 09:16:38 / janfrog" |
|
10461
8895184eb133
changed: #saveProfilerAction
Claus Gittinger <cg@exept.de>
parents:
10058
diff
changeset
|
901 |
"Modified: / 04-08-2011 / 19:06:07 / cg" |
9994 | 902 |
! ! |
903 |
||
904 |
!VisualProfilerCanvas::CallTreeItem class methodsFor:'documentation'! |
|
905 |
||
906 |
version |
|
10856 | 907 |
^'$Header: /cvs/stx/stx/libtool/Tools__VisualProfilerCanvas.st,v 1.4 2011-11-08 15:45:00 cg Exp $' |
9994 | 908 |
! ! |
909 |
||
910 |
!VisualProfilerCanvas::CallTreeItem class methodsFor:'instance creation'! |
|
911 |
||
912 |
subject: subject parent: parent |
|
913 |
||
914 |
^self new |
|
915 |
subject: subject; |
|
916 |
parent: parent; |
|
917 |
yourself |
|
918 |
||
919 |
"Created: / 10-10-2007 / 08:35:55 / janfrog" |
|
920 |
! ! |
|
921 |
||
922 |
!VisualProfilerCanvas::CallTreeItem methodsFor:'accessing'! |
|
923 |
||
924 |
children |
|
925 |
||
926 |
children ifNil:[children := self createChildren]. |
|
927 |
^children |
|
928 |
||
929 |
"Created: / 10-10-2007 / 08:38:28 / janfrog" |
|
930 |
"Modified: / 10-10-2007 / 13:24:06 / janfrog" |
|
931 |
! |
|
932 |
||
933 |
createChildren |
|
934 |
|childrenTmp childrenStream| |
|
935 |
||
936 |
self subject ifNil:[ ^ children := #() ]. |
|
937 |
childrenStream := (OrderedCollection new:self subject called size) |
|
938 |
writeStream. |
|
939 |
self createChildrenOn:childrenStream. |
|
940 |
childrenTmp := childrenStream contents. |
|
941 |
childrenTmp := self mergeChildren: childrenTmp. |
|
942 |
childrenTmp do:[:child | child parent:self]. |
|
943 |
^ childrenTmp |
|
944 |
||
945 |
"Created: / 10-10-2007 / 13:17:04 / janfrog" |
|
946 |
"Modified: / 24-11-2007 / 09:43:30 / janfrog" |
|
947 |
! |
|
948 |
||
949 |
createChildrenOn:aStream |
|
950 |
self directChildren do:[:child | |
|
951 |
child isFiltered ifTrue:[ |
|
952 |
child createChildrenOn:aStream |
|
953 |
] ifFalse:[ |
|
954 |
aStream nextPut:child |
|
955 |
] |
|
956 |
] |
|
957 |
||
958 |
"Created: / 10-10-2007 / 13:05:52 / janfrog" |
|
959 |
! |
|
960 |
||
961 |
directChildren |
|
962 |
self subject called ifNil:[ ^ #() ]. |
|
963 |
^ self subject called |
|
964 |
collect:[:childSubject | self class subject:childSubject parent:self ] |
|
965 |
||
966 |
"Created: / 10-10-2007 / 13:07:24 / janfrog" |
|
967 |
"Modified: / 24-11-2007 / 09:18:56 / janfrog" |
|
968 |
! |
|
969 |
||
970 |
label |
|
971 |
^ self totalTally printString , '% in ' |
|
972 |
, (self subject isBlock ifTrue:[ '[] in ' ] ifFalse:[ '' ]) |
|
973 |
, (self subject selector ? '<no selector>') , ' ' |
|
974 |
, ('[' , (self subject methodClass |
|
975 |
ifNil:[ 'nil class' ] |
|
976 |
ifNotNil:[ self subject methodClass name ]) |
|
977 |
, ']') allBold |
|
978 |
, ' [' , self methodPackage asString allItalic |
|
979 |
, ']' |
|
980 |
||
981 |
"Created: / 10-10-2007 / 08:40:44 / janfrog" |
|
982 |
"Modified: / 24-11-2007 / 09:42:16 / janfrog" |
|
983 |
"Modified: / 07-11-2008 / 08:40:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
984 |
! |
|
985 |
||
986 |
method |
|
987 |
self subject methodClass ifNil:[ ^ nil ]. |
|
988 |
^ self subject methodClass >> self subject selector asSymbol |
|
989 |
||
990 |
"Created: / 10-10-2007 / 08:49:58 / janfrog" |
|
991 |
"Modified: / 24-11-2007 / 09:18:56 / janfrog" |
|
992 |
! |
|
993 |
||
994 |
methodPackage |
|
995 |
||
996 |
| mth | |
|
997 |
mth := self method. |
|
998 |
mth ifNil:[^#__NoProject__]. |
|
999 |
^self method package |
|
1000 |
||
1001 |
"Created: / 10-10-2007 / 13:03:21 / janfrog" |
|
1002 |
! |
|
1003 |
||
1004 |
subject |
|
1005 |
^ subjects anyOne |
|
1006 |
||
1007 |
"Created: / 10-10-2007 / 08:35:21 / janfrog" |
|
1008 |
"Modified: / 24-11-2007 / 09:41:22 / janfrog" |
|
1009 |
! |
|
1010 |
||
1011 |
subject:anObject |
|
1012 |
subjects := Array with: anObject |
|
1013 |
||
1014 |
"Created: / 10-10-2007 / 08:35:21 / janfrog" |
|
1015 |
"Modified: / 24-11-2007 / 09:41:33 / janfrog" |
|
1016 |
! |
|
1017 |
||
1018 |
subjects |
|
1019 |
^ subjects |
|
1020 |
||
1021 |
"Created: / 24-11-2007 / 09:41:14 / janfrog" |
|
1022 |
! |
|
1023 |
||
1024 |
subjects:something |
|
1025 |
subjects := something. |
|
1026 |
||
1027 |
"Created: / 24-11-2007 / 09:41:14 / janfrog" |
|
1028 |
! |
|
1029 |
||
1030 |
totalTally |
|
1031 |
||
1032 |
^subjects inject:0 into:[:tally :subject| tally + subject totalTally] |
|
1033 |
||
1034 |
"Created: / 24-11-2007 / 09:43:01 / janfrog" |
|
1035 |
! ! |
|
1036 |
||
1037 |
!VisualProfilerCanvas::CallTreeItem methodsFor:'change & update'! |
|
1038 |
||
1039 |
updateChildren |
|
1040 |
||
1041 |
self removeAll. |
|
1042 |
self addAll:self createChildren |
|
1043 |
||
1044 |
"Created: / 10-10-2007 / 13:02:13 / janfrog" |
|
1045 |
! ! |
|
1046 |
||
1047 |
!VisualProfilerCanvas::CallTreeItem methodsFor:'comparing'! |
|
1048 |
||
1049 |
shouldBeMergedWith:anotherCallTreeItem |
|
1050 |
^ self subject methodClass = anotherCallTreeItem subject methodClass |
|
1051 |
and:[ |
|
1052 |
self subject selector = anotherCallTreeItem subject selector |
|
1053 |
and:[ self subject isBlock not ] |
|
1054 |
] |
|
1055 |
||
1056 |
"Created: / 24-11-2007 / 09:50:34 / janfrog" |
|
1057 |
! ! |
|
1058 |
||
1059 |
!VisualProfilerCanvas::CallTreeItem methodsFor:'private'! |
|
1060 |
||
1061 |
mergeChildren: rawChildren |
|
1062 |
||
1063 |
|mergedChildren| |
|
1064 |
||
1065 |
mergedChildren := OrderedCollection new. |
|
1066 |
[rawChildren isEmpty] whileFalse: |
|
1067 |
[|childToMerge childrenToMerge| |
|
1068 |
childToMerge := mergedChildren add:(rawChildren removeFirst). |
|
1069 |
childrenToMerge := rawChildren select:[:e|e shouldBeMergedWith:childToMerge]. |
|
1070 |
rawChildren removeAll: childrenToMerge. |
|
1071 |
childrenToMerge do:[:e|childToMerge subjects addAll:e subjects]. |
|
1072 |
]. |
|
1073 |
^mergedChildren |
|
1074 |
||
1075 |
"Created: / 24-11-2007 / 09:20:07 / janfrog" |
|
1076 |
! ! |
|
1077 |
||
1078 |
!VisualProfilerCanvas::CallTreeItem methodsFor:'testing'! |
|
1079 |
||
1080 |
isFiltered |
|
1081 |
||
1082 |
| isFiltered | |
|
1083 |
isFiltered := false. |
|
1084 |
self application packageFilter value |
|
1085 |
ifNotNil:[isFiltered := (self application packageFilter value includes: self methodPackage) not]. |
|
1086 |
^isFiltered |
|
1087 |
||
1088 |
"Created: / 10-10-2007 / 13:09:46 / janfrog" |
|
1089 |
! ! |
|
1090 |
||
1091 |
!VisualProfilerCanvas class methodsFor:'documentation'! |
|
1092 |
||
1093 |
version_CVS |
|
10856 | 1094 |
^ '$Header: /cvs/stx/stx/libtool/Tools__VisualProfilerCanvas.st,v 1.4 2011-11-08 15:45:00 cg Exp $' |
9994 | 1095 |
! |
1096 |
||
1097 |
version_SVN |
|
1098 |
^ '§Id: Tools__VisualProfilerCanvas.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
1099 |
! ! |