This is a static copy of a profile report

Home

scribe.legend.init (14 calls, 1.213 sec)
Generated 05-Aug-2011 13:01:50 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/@scribe/@legend/init.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
scribe.legend.legendfunction14
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
137
legendcolorbarlayout(ax,'addTo...
140.514 s42.3%
128
methods(h,'set_contextmenu','o...
140.197 s16.2%
135
graph2dhelper('updateLegendMen...
140.142 s11.7%
138
legendcolorbarlayout(ax,'layou...
140.120 s9.9%
124
methods(h,'create_plotchild_li...
140.098 s8.1%
All other lines  0.142 s11.7%
Totals  1.213 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
legendcolorbarlayoutfunction420.678 s55.9%
scribe.legend.methodsfunction420.295 s24.3%
graph2dhelperfunction840.142 s11.7%
scribe.legend.init>setWidthHeightsubfunction140.011 s0.9%
findallfunction140.011 s0.9%
scribe.legendinfo.schemafunction10 s0%
ispropfunction280 s0%
opaque.doublefunction1540 s0%
Self time (built-ins, overhead, etc.)  0.077 s6.3%
Totals  1.213 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function140
Non-code lines (comments, blank lines)53
Code lines (lines that can run)87
Code lines that did run80
Code lines that did not run7
Coverage (did run/can run)91.95 %
Function listing
   time   calls  line
1 function init(h)
2 %INIT Initlialize legend listeners and application data
3 % INIT(H) initializes the legend state for legend H.
4
5 % Copyright 1984-2008 The MathWorks, Inc.
6 % $Revision: 1.1.6.11 $ $Date: 2008/12/04 22:40:49 $
7
14 8 hax = h.Axes;
14 9 ax = double(hax);
14 10 fig = ancestor(h, 'figure');
11
12
13 % prevent addition of title, xlabel and ylabel
14 14 setappdata(double(h),'MWBYPASS_title',{graph2dhelper('noop')});
14 15 setappdata(double(h),'MWBYPASS_xlabel',{graph2dhelper('noop')});
14 16 setappdata(double(h),'MWBYPASS_ylabel',{graph2dhelper('noop')});
14 17 setappdata(double(h),'MWBYPASS_zlabel',{graph2dhelper('noop')});
14 18 setappdata(double(h),'NonDataObject',[]);
14 19 setappdata(double(h),'PostDeserializeFcn',graph2dhelper('legendpostdeserialize'));
14 20 set(double(h),'Tag','legend');
21
22 %set up listeners-----------------------------------------
14 23 l= handle.listener(h,h.findprop('Position'),...
24 'PropertyPostSet',{@changedPos,h,'position'});
14 25 l(end+1)= handle.listener(h,h.findprop('OuterPosition'),...
26 'PropertyPostSet',{@changedPos,h,'outerposition'});
14 27 l(end+1)= handle.listener(h,h.findprop('Units'),...
28 'PropertyPreSet',{@changedUnits,h,'off'});
29
30 % the units post-set must be listener number 4. see the callback
31 % for details
14 32 l(end+1)= handle.listener(h,h.findprop('Units'),...
33 'PropertyPostSet',{@changedUnits,h,'on'});
14 34 l(end+1)= handle.listener(h,h.findprop('Position'),...
35 'PropertyPreGet',{@computePos,h});
14 36 l(end+1)= handle.listener(h,h.findprop('OuterPosition'),...
37 'PropertyPreGet',{@computePos,h});
14 38 l(end+1)= handle.listener(h,h.findprop('Location'),...
39 'PropertyPostSet',{@changedLocation,ax});
14 40 l(end+1)= handle.listener(h,h.findprop('Orientation'),...
41 'PropertyPostSet',{@changedOrientation,ax});
14 42 l(end+1)= handle.listener(h,h.findprop('TextColor'),...
43 'PropertyPostSet',@changedTextColor);
14 44 l(end+1)= handle.listener(h,h.findprop('Interpreter'),...
45 'PropertyPostSet',@changedFontProperties);
14 46 l(end+1)= handle.listener(h,h.findprop('Box'),...
47 'PropertyPostSet',@changedBox);
14 48 l(end+1)= handle.listener(h,h.findprop('String'),...
49 'PropertyPostSet',@changedString);
14 50 l(end+1)= handle.listener(h,h.findprop('Visible'),...
51 'PropertyPostSet',@changedVisibility);
14 52 l(end+1)= handle.listener(h,h.findprop('FontName'),...
53 'PropertyPostSet',@changedFontProperties);
14 54 l(end+1)= handle.listener(h,h.findprop('FontSize'),...
55 'PropertyPostSet',@changedFontProperties);
0.02 14 56 l(end+1)= handle.listener(h,h.findprop('FontWeight'),...
57 'PropertyPostSet',@changedFontProperties);
14 58 l(end+1)= handle.listener(h,h.findprop('FontAngle'),...
59 'PropertyPostSet',@changedFontProperties);
14 60 l(end+1)= handle.listener(h,h.findprop('LineWidth'),...
61 'PropertyPostSet',@changedLineWidth);
14 62 hparent = handle(get(h,'Parent'));
14 63 l(end+1)= handle.listener(hparent,'ResizeEvent', {@setWidthHeight,h});
14 64 l(end+1)= handle.listener(h,'LegendInfoChanged',@changedLegendInfo);
14 65 h.PropertyListeners = l;
14 66 l = handle.listener(h,'ObjectBeingDestroyed',{@legendDeleted,h});
14 67 h.DeleteListener = l;
68
69 % add listeners to figure
14 70 if ~isprop(handle(fig),'ScribeLegendListeners')
4 71 l = schema.prop(handle(fig),'ScribeLegendListeners','MATLAB array');
4 72 l.AccessFlags.Serialize = 'off';
4 73 l.Visible = 'off';
4 74 end
14 75 if (isempty(get(fig, 'ScribeLegendListeners')))
4 76 cls = classhandle(handle(fig));
4 77 flis.currentaxes = handle.listener(handle(fig), cls.findprop('CurrentAxes'),...
78 'PropertyPostSet', @changedCurrentAxes);
4 79 set(handle(fig),'ScribeLegendListeners',flis);
4 80 end
81
14 82 if ~isempty(hax)
83 % add listeners to plotaxes
14 84 if ~isprop(hax,'ScribeLegendListeners')
8 85 l = schema.prop(hax,'ScribeLegendListeners','MATLAB array');
8 86 l.AccessFlags.Serialize = 'off';
8 87 l.Visible = 'off';
8 88 end
14 89 cls = classhandle(hax);
0.01 14 90 lis.fontname = handle.listener(hax, cls.findprop('FontName'),...
91 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
14 92 lis.fontsize = handle.listener(hax, cls.findprop('FontSize'),...
93 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
0.01 14 94 lis.fontweight = handle.listener(hax, cls.findprop('FontWeight'),...
95 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
14 96 lis.fontangle = handle.listener(hax, cls.findprop('FontAngle'),...
97 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
14 98 lis.linewidth = handle.listener(hax, cls.findprop('LineWidth'),...
99 'PropertyPostSet', {@PlotAxesChangedLineWidth,h});
14 100 lis.deleted = handle.listener(hax, 'ObjectBeingDestroyed', {@PlotAxesDeleted,h});
14 101 if isequal(h.PlotChildListen,'on')
102 lis.childadded = handle.listener(hax, 'ObjectChildAdded', {@PlotAxesChildAdded,h});
103 end
0.01 14 104 existing_proxy = findall(ax,'tag','LegendDeleteProxy');
14 105 if ~isempty(existing_proxy)
106 set(existing_proxy,'DeleteFcn','');
107 if length(existing_proxy) > 1
108 delete(existing_proxy(2:end));
109 end
110 h.DeleteProxy = handle(existing_proxy(1));
14 111 else
14 112 h.DeleteProxy = handle(text('parent',ax,...
113 'visible','off', ...
114 'tag','LegendDeleteProxy',...
115 'handlevisibility','off'));
14 116 end
14 117 lis.proxydeleted = handle.listener(h.DeleteProxy, 'ObjectBeingDestroyed', {@PlotAxesCleared,h});
14 118 set(hax,'ScribeLegendListeners',lis);
119
120 % add listeners to plotchildren
14 121 if ~isempty(h.Plotchildren) && ~isa(h.Plotchildren(1),'scribe.legendinfo')
14 122 hpch = h.Plotchildren;
14 123 pch = double(hpch);
0.10 14 124 methods(h,'create_plotchild_listeners',hpch,pch)
14 125 end
14 126 end
127
0.20 14 128 methods(h,'set_contextmenu','on');
129
130 %Add Button down function
14 131 set(double(h),'ButtonDownFcn',methods(h,'getfunhan','bdowncb'));
132
133 % set correct state of cbar toggle and menuitem
14 134 if ~isempty(ax)
0.14 14 135 graph2dhelper('updateLegendMenuToolbar', [], [], ax);
0.08 14 136 legendcolorbarlayout(ax,'on')
0.51 14 137 legendcolorbarlayout(ax,'addToLayoutList',double(h))
0.12 14 138 legendcolorbarlayout(ax,'layout')
14 139 end
0.01 14 140 setWidthHeight([],[],h);

Other subfunctions in this file are not included in this listing.