This is a static copy of a profile reportHome
scribe/private/updateLegendMenuToolbar (2 calls, 0.031 sec)
Generated 18-Mar-2011 23:32:26 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/toolbox/matlab/scribe/private/updateLegendMenuToolbar.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
16 | ltogg = uigettool(fig,'Annotat... | 2 | 0.021 s | 66.7% |  |
20 | cbmenu = findall(fig,'Tag','fi... | 2 | 0.010 s | 33.3% |  |
74 | end | 2 | 0 s | 0% |  |
73 | end | 2 | 0 s | 0% |  |
72 | set(cbmenu,'checked','off'); | 2 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.031 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
uigettool | M-function | 4 | 0.021 s | 66.7% |  |
findall | M-function | 4 | 0.010 s | 33.3% |  |
opaque.double | M-function | 2 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0 s | 0% |  |
Totals | | | 0.031 s | 100% | |
M-Lint results
No M-Lint messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 74 |
Non-code lines (comments, blank lines) | 17 |
Code lines (lines that can run) | 57 |
Code lines that did run | 35 |
Code lines that did not run | 22 |
Coverage (did run/can run) | 61.40 % |
Function listing
time calls line
1 function updateLegendMenuToolbar(hProp,eventData, cax) %#ok
2 %updateLegendMenuToolbar Update menu and toolbar for legend
3
4 % Copyright 2005-2007 The MathWorks, Inc.
5
2 6 if ~isempty(eventData), cax = eventData.NewValue; end
2 7 cax = double(cax);
2 8 fig = ancestor(cax,'figure');
9
2 10 if isa(handle(cax),'scribe.legend') || isa(handle(cax),'scribe.colorbar')
11 hlc = handle(cax);
12 cax = double(hlc.Axes);
13 end
14
15 %Get the legend toggle and the legend menuitem
0.02 2 16 ltogg = uigettool(fig,'Annotation.InsertLegend');
2 17 lmenu = findall(fig,'Tag','figMenuInsertLegend');
18 %Get the colorbar toggle and the colorbar menuitem
2 19 cbtogg = uigettool(fig,'Annotation.InsertColorbar');
0.01 2 20 cbmenu = findall(fig,'Tag','figMenuInsertColorbar');
21
22 %Check if the legend is on for the current axes
2 23 legs = find(handle(fig),'-isa','scribe.legend');
2 24 legon = false;
2 25 for k=1:length(legs)
2 26 leg = handle(legs(k));
2 27 if isequal(double(leg.Axes),cax) && ...
28 ~strcmpi(get(leg,'BeingDeleted'),'on')
2 29 legon=true;
2 30 end
2 31 end
32 %Check if the colorbar is on for the current axes
2 33 cbars = find(handle(fig),'-isa','scribe.colorbar');
2 34 cbaron = false;
2 35 for k=1:length(cbars)
36 cbar = handle(cbars(k));
37 if isequal(double(cbar.Axes),cax) && ...
38 ~strcmpi(get(cbar,'BeingDeleted'),'on')
39 cbaron=true;
40 end
41 end
42
43 %set the legend toggle/menuitem appropriately
2 44 if legon
2 45 if ~isempty(ltogg)
2 46 set(ltogg,'state','on');
2 47 end
2 48 if ~isempty(lmenu)
2 49 set(lmenu,'checked','on');
2 50 end
51 else
52 if ~isempty(ltogg)
53 set(ltogg,'state','off');
54 end
55 if ~isempty(lmenu)
56 set(lmenu,'checked','off');
57 end
58 end
59 %set the colorbar toggle/menuitem appropriately
2 60 if cbaron
61 if ~isempty(cbtogg)
62 set(cbtogg,'state','on');
63 end
64 if ~isempty(cbmenu)
65 set(cbmenu,'checked','on');
66 end
2 67 else
2 68 if ~isempty(cbtogg)
2 69 set(cbtogg,'state','off');
2 70 end
2 71 if ~isempty(cbmenu)
2 72 set(cbmenu,'checked','off');
2 73 end
2 74 end