This is a static copy of a profile report

Home

scribe.legend.init (2 calls, 0.270 sec)
Generated 18-Mar-2011 23:31:55 using cpu time.
M-function in file /Applications/MATLAB_R2010a.app/toolbox/matlab/scribe/@scribe/@legend/init.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
scribe.legend.legendM-function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
138
legendcolorbarlayout(ax,'layou...
20.073 s26.9%
128
methods(h,'set_contextmenu','o...
20.073 s26.9%
135
graph2dhelper('updateLegendMen...
20.031 s11.5%
136
legendcolorbarlayout(ax,'on')
20.021 s7.7%
124
methods(h,'create_plotchild_li...
20.021 s7.7%
All other lines  0.052 s19.2%
Totals  0.270 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
legendcolorbarlayoutM-function60.104 s38.5%
scribe.legend.methodsM-function60.104 s38.5%
graph2dhelperM-function120.031 s11.5%
findallM-function20.010 s3.8%
scribe.legend.init>setWidthHeightM-subfunction20 s0%
ispropM-function40 s0%
opaque.doubleM-function220 s0%
Self time (built-ins, overhead, etc.)  0.021 s7.7%
Totals  0.270 s100% 
M-Lint 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
2 8 hax = h.Axes;
2 9 ax = double(hax);
2 10 fig = ancestor(h, 'figure');
11
12
13 % prevent addition of title, xlabel and ylabel
2 14 setappdata(double(h),'MWBYPASS_title',{graph2dhelper('noop')});
2 15 setappdata(double(h),'MWBYPASS_xlabel',{graph2dhelper('noop')});
2 16 setappdata(double(h),'MWBYPASS_ylabel',{graph2dhelper('noop')});
2 17 setappdata(double(h),'MWBYPASS_zlabel',{graph2dhelper('noop')});
2 18 setappdata(double(h),'NonDataObject',[]);
2 19 setappdata(double(h),'PostDeserializeFcn',graph2dhelper('legendpostdeserialize'));
2 20 set(double(h),'Tag','legend');
21
22 %set up listeners-----------------------------------------
2 23 l= handle.listener(h,h.findprop('Position'),...
24 'PropertyPostSet',{@changedPos,h,'position'});
2 25 l(end+1)= handle.listener(h,h.findprop('OuterPosition'),...
26 'PropertyPostSet',{@changedPos,h,'outerposition'});
2 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
2 32 l(end+1)= handle.listener(h,h.findprop('Units'),...
33 'PropertyPostSet',{@changedUnits,h,'on'});
0.01 2 34 l(end+1)= handle.listener(h,h.findprop('Position'),...
35 'PropertyPreGet',{@computePos,h});
2 36 l(end+1)= handle.listener(h,h.findprop('OuterPosition'),...
37 'PropertyPreGet',{@computePos,h});
2 38 l(end+1)= handle.listener(h,h.findprop('Location'),...
39 'PropertyPostSet',{@changedLocation,ax});
2 40 l(end+1)= handle.listener(h,h.findprop('Orientation'),...
41 'PropertyPostSet',{@changedOrientation,ax});
2 42 l(end+1)= handle.listener(h,h.findprop('TextColor'),...
43 'PropertyPostSet',@changedTextColor);
2 44 l(end+1)= handle.listener(h,h.findprop('Interpreter'),...
45 'PropertyPostSet',@changedFontProperties);
2 46 l(end+1)= handle.listener(h,h.findprop('Box'),...
47 'PropertyPostSet',@changedBox);
2 48 l(end+1)= handle.listener(h,h.findprop('String'),...
49 'PropertyPostSet',@changedString);
2 50 l(end+1)= handle.listener(h,h.findprop('Visible'),...
51 'PropertyPostSet',@changedVisibility);
2 52 l(end+1)= handle.listener(h,h.findprop('FontName'),...
53 'PropertyPostSet',@changedFontProperties);
0.01 2 54 l(end+1)= handle.listener(h,h.findprop('FontSize'),...
55 'PropertyPostSet',@changedFontProperties);
2 56 l(end+1)= handle.listener(h,h.findprop('FontWeight'),...
57 'PropertyPostSet',@changedFontProperties);
2 58 l(end+1)= handle.listener(h,h.findprop('FontAngle'),...
59 'PropertyPostSet',@changedFontProperties);
2 60 l(end+1)= handle.listener(h,h.findprop('LineWidth'),...
61 'PropertyPostSet',@changedLineWidth);
2 62 hparent = handle(get(h,'Parent'));
2 63 l(end+1)= handle.listener(hparent,'ResizeEvent', {@setWidthHeight,h});
2 64 l(end+1)= handle.listener(h,'LegendInfoChanged',@changedLegendInfo);
2 65 h.PropertyListeners = l;
2 66 l = handle.listener(h,'ObjectBeingDestroyed',{@legendDeleted,h});
2 67 h.DeleteListener = l;
68
69 % add listeners to figure
2 70 if ~isprop(handle(fig),'ScribeLegendListeners')
2 71 l = schema.prop(handle(fig),'ScribeLegendListeners','MATLAB array');
2 72 l.AccessFlags.Serialize = 'off';
2 73 l.Visible = 'off';
2 74 end
2 75 if (isempty(get(fig, 'ScribeLegendListeners')))
2 76 cls = classhandle(handle(fig));
2 77 flis.currentaxes = handle.listener(handle(fig), cls.findprop('CurrentAxes'),...
78 'PropertyPostSet', @changedCurrentAxes);
2 79 set(handle(fig),'ScribeLegendListeners',flis);
2 80 end
81
2 82 if ~isempty(hax)
83 % add listeners to plotaxes
2 84 if ~isprop(hax,'ScribeLegendListeners')
2 85 l = schema.prop(hax,'ScribeLegendListeners','MATLAB array');
2 86 l.AccessFlags.Serialize = 'off';
2 87 l.Visible = 'off';
2 88 end
2 89 cls = classhandle(hax);
2 90 lis.fontname = handle.listener(hax, cls.findprop('FontName'),...
91 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
2 92 lis.fontsize = handle.listener(hax, cls.findprop('FontSize'),...
93 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
2 94 lis.fontweight = handle.listener(hax, cls.findprop('FontWeight'),...
95 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
2 96 lis.fontangle = handle.listener(hax, cls.findprop('FontAngle'),...
97 'PropertyPostSet', {@PlotAxesChangedFontProperties,h});
2 98 lis.linewidth = handle.listener(hax, cls.findprop('LineWidth'),...
99 'PropertyPostSet', {@PlotAxesChangedLineWidth,h});
2 100 lis.deleted = handle.listener(hax, 'ObjectBeingDestroyed', {@PlotAxesDeleted,h});
2 101 if isequal(h.PlotChildListen,'on')
102 lis.childadded = handle.listener(hax, 'ObjectChildAdded', {@PlotAxesChildAdded,h});
103 end
0.01 2 104 existing_proxy = findall(ax,'tag','LegendDeleteProxy');
2 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));
2 111 else
2 112 h.DeleteProxy = handle(text('parent',ax,...
113 'visible','off', ...
114 'tag','LegendDeleteProxy',...
115 'handlevisibility','off'));
2 116 end
2 117 lis.proxydeleted = handle.listener(h.DeleteProxy, 'ObjectBeingDestroyed', {@PlotAxesCleared,h});
2 118 set(hax,'ScribeLegendListeners',lis);
119
120 % add listeners to plotchildren
2 121 if ~isempty(h.Plotchildren) && ~isa(h.Plotchildren(1),'scribe.legendinfo')
2 122 hpch = h.Plotchildren;
2 123 pch = double(hpch);
0.02 2 124 methods(h,'create_plotchild_listeners',hpch,pch)
2 125 end
2 126 end
127
0.07 2 128 methods(h,'set_contextmenu','on');
129
130 %Add Button down function
0.01 2 131 set(double(h),'ButtonDownFcn',methods(h,'getfunhan','bdowncb'));
132
133 % set correct state of cbar toggle and menuitem
2 134 if ~isempty(ax)
0.03 2 135 graph2dhelper('updateLegendMenuToolbar', [], [], ax);
0.02 2 136 legendcolorbarlayout(ax,'on')
0.01 2 137 legendcolorbarlayout(ax,'addToLayoutList',double(h))
0.07 2 138 legendcolorbarlayout(ax,'layout')
2 139 end
2 140 setWidthHeight([],[],h);

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