This is a static copy of a profile report

Home

scribe/private/updateLegendMenuToolbar (89 calls, 0.700 sec)
Generated 05-Aug-2011 13:01:55 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/private/updateLegendMenuToolbar.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
graph2dhelperfunction89
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
20
cbmenu = findall(fig,'Tag','fi...
890.197 s28.1%
17
lmenu = findall(fig,'Tag','fig...
890.197 s28.1%
16
ltogg = uigettool(fig,'Annotat...
890.142 s20.3%
19
cbtogg = uigettool(fig,'Annota...
890.087 s12.5%
69
set(cbtogg,'state','off');
870.011 s1.6%
All other lines  0.066 s9.4%
Totals  0.700 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
findallfunction1780.383 s54.7%
uigettoolfunction1780.230 s32.8%
opaque.doublefunction810.011 s1.6%
Self time (built-ins, overhead, etc.)  0.077 s10.9%
Totals  0.700 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function74
Non-code lines (comments, blank lines)17
Code lines (lines that can run)57
Code lines that did run43
Code lines that did not run14
Coverage (did run/can run)75.44 %
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
89 6 if ~isempty(eventData), cax = eventData.NewValue; end
89 7 cax = double(cax);
89 8 fig = ancestor(cax,'figure');
9
0.01 89 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.14 89 16 ltogg = uigettool(fig,'Annotation.InsertLegend');
0.20 89 17 lmenu = findall(fig,'Tag','figMenuInsertLegend');
18 %Get the colorbar toggle and the colorbar menuitem
0.09 89 19 cbtogg = uigettool(fig,'Annotation.InsertColorbar');
0.20 89 20 cbmenu = findall(fig,'Tag','figMenuInsertColorbar');
21
22 %Check if the legend is on for the current axes
0.01 89 23 legs = find(handle(fig),'-isa','scribe.legend');
89 24 legon = false;
89 25 for k=1:length(legs)
81 26 leg = handle(legs(k));
0.01 81 27 if isequal(double(leg.Axes),cax) && ...
28 ~strcmpi(get(leg,'BeingDeleted'),'on')
20 29 legon=true;
20 30 end
81 31 end
32 %Check if the colorbar is on for the current axes
0.01 89 33 cbars = find(handle(fig),'-isa','scribe.colorbar');
89 34 cbaron = false;
0.01 89 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
89 44 if legon
20 45 if ~isempty(ltogg)
20 46 set(ltogg,'state','on');
20 47 end
20 48 if ~isempty(lmenu)
20 49 set(lmenu,'checked','on');
20 50 end
69 51 else
69 52 if ~isempty(ltogg)
67 53 set(ltogg,'state','off');
67 54 end
69 55 if ~isempty(lmenu)
67 56 set(lmenu,'checked','off');
67 57 end
69 58 end
59 %set the colorbar toggle/menuitem appropriately
89 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
89 67 else
89 68 if ~isempty(cbtogg)
0.01 87 69 set(cbtogg,'state','off');
87 70 end
89 71 if ~isempty(cbmenu)
87 72 set(cbmenu,'checked','off');
87 73 end
89 74 end