This is a static copy of a profile reportHome
scribe.legend.methods>set_contextmenu (14 calls, 0.197 sec)
Generated 05-Aug-2011 13:02:24 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/scribe/@scribe/@legend/methods.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 |
1144 | hMenu(end+1) = graph2dhelper('... | 14 | 0.044 s | 22.2% |  |
1168 | hMenu(end+1) = graph2dhelper('... | 14 | 0.033 s | 16.7% |  |
1162 | hChil = findall(hMenu(end)); | 14 | 0.022 s | 11.1% |  |
1160 | hMenu(end+1) = graph2dhelper('... | 14 | 0.022 s | 11.1% |  |
1131 | hMenu = graph2dhelper('createS... | 14 | 0.022 s | 11.1% |  |
All other lines | | | 0.055 s | 27.8% |  |
Totals | | | 0.197 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
graph2dhelper | function | 126 | 0.120 s | 61.1% |  |
findall | function | 70 | 0.022 s | 11.1% |  |
flipud | function | 42 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.055 s | 27.8% |  |
Totals | | | 0.197 s | 100% | |
Code Analyzer results
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 84 |
Non-code lines (comments, blank lines) | 32 |
Code lines (lines that can run) | 52 |
Code lines that did run | 52 |
Code lines that did not run | 0 |
Coverage (did run/can run) | 100.00 % |
Function listing
time calls line
1123 function set_contextmenu(h,onoff) %#ok
1124
14 1125 fig = ancestor(h,'figure');
14 1126 uic = get(h,'UIContextMenu');
14 1127 if isempty(uic)
14 1128 uic = uicontextmenu('Parent',fig,'HandleVisibility','off');
14 1129 setappdata(uic,'CallbackObject',h);
1130 % Refresh
0.02 14 1131 hMenu = graph2dhelper('createScribeUIMenuEntry',fig,'GeneralAction','Refresh','','',{@refresh_cb,h});
14 1132 set(hMenu,'Tag','scribe:legend:refresh');
1133 % Delete
14 1134 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'GeneralAction','Delete','','',{@delete_cb,h});
14 1135 set(hMenu(end),'Tag','scribe:legend:delete');
1136 % Color
14 1137 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'Color','Color ...','Color','Color');
14 1138 set(hMenu(end),'Separator','on');
14 1139 set(hMenu(end),'Tag','scribe:legend:color');
1140 % Edge color (xcolor and ycolor)
14 1141 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'Color','Edge Color ...',{'XColor','YColor'},'Edge Color');
0.01 14 1142 set(hMenu(end),'Tag','scribe:legend:edgecolor');
1143 % Line width
0.04 14 1144 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'LineWidth','Line Width','LineWidth','Line Width');
14 1145 set(hMenu(end),'Tag','scribe:legend:linewidth');
14 1146 hChil = findall(hMenu(end));
14 1147 hChil = hChil(2:end);
14 1148 widthTags = {'scribe:legend:linewidth:12.0';'scribe:legend:linewidth:11.0';...
1149 'scribe:legend:linewidth:10.0';'scribe:legend:linewidth:9.0';...
1150 'scribe:legend:linewidth:8.0';'scribe:legend:linewidth:7.0';...
1151 'scribe:legend:linewidth:6.0';'scribe:legend:linewidth:5.0';...
1152 'scribe:legend:linewidth:4.0';'scribe:legend:linewidth:3.0';...
1153 'scribe:legend:linewidth:2.0';'scribe:legend:linewidth:1.0';...
1154 'scribe:legend:linewidth:0.5'};
14 1155 set(hChil,{'Tag'},widthTags);
1156 % Font properties
14 1157 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'Font','Font ...','','Font');
14 1158 set(hMenu(end),'Tag','scribe:legend:font');
1159 % Interpreter
0.02 14 1160 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'TextInterpreter','Interpreter','Interpreter','Interpreter');
14 1161 set(hMenu(end),'Tag','scribe:legend:interpreter');
0.02 14 1162 hChil = findall(hMenu(end));
14 1163 hChil = flipud(hChil(2:end));
14 1164 intTags = {'scribe:legend:interpreter:latex';'scribe:legend:interpreter:tex';...
1165 'scribe:legend:interpreter:none'};
14 1166 set(hChil,{'Tag'},intTags);
1167 % Location
0.03 14 1168 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'EnumEntry','Location','Location','Location',...
1169 {'Best','Inside North East','Outside North East','Inside South East',...
1170 'Inside North West','Outside North West','Inside South West'},...
1171 {'Best','NorthEast','NorthEastOutside','SouthEast','NorthWest','NorthWestOutside','SouthWest'});
0.01 14 1172 set(hMenu(end),'Tag','scribe:legend:location');
0.01 14 1173 hChil = findall(hMenu(end));
14 1174 hChil = flipud(hChil(2:end));
14 1175 loctags = {'scribe:legend:location:best';'scribe:legend:location:northeast';...
1176 'scribe:legend:location:northeastoutside';'scribe:legend:location:southeast';...
1177 'scribe:legend:location:northwest';'scribe:legend:location:northwestoutside';...
1178 'scribe:legend:location:southwest'};
14 1179 set(hChil,{'Tag'},loctags);
1180 % Orientation
14 1181 hMenu(end+1) = graph2dhelper('createScribeUIMenuEntry',fig,'EnumEntry','Orientation','Orientation','Orientation',...
1182 {'vertical','horizontal'},{'vertical','horizontal'});
14 1183 set(hMenu(end),'Tag','scribe:legend:orientation');
14 1184 hChil = findall(hMenu(end));
14 1185 hChil = flipud(hChil(2:end));
14 1186 ortags = {'scribe:legend:orientation:vertical';'scribe:legend:orientation:horizontal'};
14 1187 set(hChil,{'Tag'},ortags);
1188 % Set the parent of the menus
14 1189 set(hMenu,'Parent',uic);
14 1190 set(findall(hMenu),'Visible','on');
1191 % Property Editor. Do not add the menu for deployed applications.
14 1192 if( ~isdeployed && ~ismcc)
0.01 14 1193 hMenu = uimenu(uic,'HandleVisibility','off','Separator','on',...
1194 'Label','Show Property Editor','Callback',{@localOpenPropertyEditor,h});
14 1195 set(hMenu,'Tag','scribe:legend:propedit');
14 1196 end
1197 % Code. Do not add the menu for deployed applications.
14 1198 if ( ~isdeployed && ~ismcc)
14 1199 hMenu = uimenu(uic,'HandleVisibility','off','Separator','on',...
1200 'Label','Show Code','Callback',{@localGenerateMCode,h});
14 1201 set(hMenu,'Tag','scribe:legend:mcode');
14 1202 end
1203
1204 % set the context menu
14 1205 set(h,'uicontextmenu',uic);
14 1206 end
Other subfunctions in this file are not included in this listing.