This is a static copy of a profile reportHome
legendcolorbarlayout>doLayout (171 calls, 1.016 sec)
Generated 05-Aug-2011 13:02:40 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/legendcolorbarlayout.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 |
438 | doInOutLayout(par,fig,inlist,c... | 165 | 0.459 s | 45.2% |  |
423 | [corner1,corner2] = getPixelBo... | 165 | 0.350 s | 34.4% |  |
405 | if validateTextObjects(textObj... | 171 | 0.055 s | 5.4% |  |
404 | localValidateLists(ax); | 171 | 0.044 s | 4.3% |  |
425 | corner2 = toPoints((corner2(1:... | 165 | 0.022 s | 2.2% |  |
All other lines | | | 0.087 s | 8.6% |  |
Totals | | | 1.016 s | 100% | |
Children (called functions)
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 50 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 42 |
Code lines that did run | 30 |
Code lines that did not run | 12 |
Coverage (did run/can run) | 71.43 % |
Function listing
time calls line
402 function doLayout(ax,withPixBounds)
0.01 171 403 textObjects = getappdata(double(ax),'LegendColorbarText');
0.04 171 404 localValidateLists(ax);
0.05 171 405 if validateTextObjects(textObjects,ax)
171 406 if nargin == 1, withPixBounds = true; end
171 407 outlist = getappdata(ax,'LegendColorbarOuterList');
171 408 inlist = getappdata(ax,'LegendColorbarInnerList');
171 409 if ~isempty(inlist) || ~isempty(outlist)
0.01 165 410 listenerlist = getListeners(ax);
165 411 oldstate = get(listenerlist,'enable');
165 412 set(listenerlist,'enable','off')
0.01 165 413 oldlayout = getappdata(ax,'inLayout');
165 414 setappdata(ax,'inLayout',true);
415
165 416 textObjects = getappdata(ax,'LegendColorbarText');
0.01 165 417 par = get(ax,'Parent');
165 418 fig = par;
165 419 if ~strcmp(get(fig,'Type'),'figure')
420 fig = ancestor(fig,'figure');
421 end
0.02 165 422 if is2D(ax)
0.35 165 423 [corner1,corner2] = getPixelBounds(ax,textObjects,withPixBounds);
165 424 corner1 = toPoints((corner1(1:2)+corner1(3:4))/2,fig);
0.02 165 425 corner2 = toPoints((corner2(1:2)+corner2(3:4))/2,fig);
426 else
427 pixpos = getpixelposition(ax,true);
428 corner1 = toPoints(pixpos(1:2),fig);
429 corner2 = toPoints(pixpos(1:2) + pixpos(3:4),fig);
430 % flip y direction for screen orientation
431 figpos = hgconvertunits(fig,get(fig,'Position'),get(fig,'Units'),...
432 'points',0);
433 corner1(2) = figpos(4)-corner1(2);
434 corner2(2) = figpos(4)-corner2(2);
435 end
436
165 437 if ~isempty(inlist)
0.46 165 438 doInOutLayout(par,fig,inlist,corner1,corner2,true);
165 439 end
165 440 if ~isempty(outlist)
441 doInOutLayout(par,fig,outlist,corner1,corner2,false);
442 end
443
444 % cache the position for the legend pre-get listener
165 445 axPos = get(ax,'Position');
165 446 setappdata(ax,'LegendComputePosCache',axPos);
447
0.01 165 448 setappdata(ax,'inLayout',oldlayout);
165 449 set(listenerlist,{'enable'},oldstate)
165 450 end
171 451 end
Other subfunctions in this file are not included in this listing.