time | Calls | line |
---|
| | 1 | function fireprintbehavior(pj,callbackName)
|
| | 2 | %FIREPRINTBEHAVIOR Fire callback for Print behavior customization
|
| | 3 | % Helper function for printing. Do not call directly.
|
| | 4 |
|
| | 5 | % Copyright 1984-2017 The MathWorks, Inc.
|
| | 6 |
|
< 0.001 | 2 | 7 | h = pj.Handles{1};
|
0.018 | 2 | 8 | allobj = findall(h, 'Type', 'figure', ...
|
| | 9 | '-or', 'Type', 'axes', ...
|
| | 10 | '-or', 'Type', 'polaraxes', ...
|
| | 11 | '-or', 'Type', 'legend', ...
|
| | 12 | '-or', '-isa', 'matlab.graphics.shape.internal.ScribeGrid', ...
|
| | 13 | '-or', '-isa', 'matlab.graphics.chart.Chart');
|
< 0.001 | 2 | 14 | for k=1:length(allobj)
|
< 0.001 | 4 | 15 | obj = allobj(k);
|
< 0.001 | 4 | 16 | if ishandle(obj) % callbacks might delete other handles
|
0.006 | 4 | 17 | behavior = hggetbehavior(obj,'Print','-peek');
|
< 0.001 | 4 | 18 | if ~isempty(behavior) && isprop(behavior, callbackName) && ...
|
| | 19 | ~isempty(get(behavior,callbackName))
|
| | 20 |
|
| | 21 | % provide appdata for obj to use during its print callback
|
| | 22 | pci.DriverClass = pj.DriverClass;
|
| | 23 | setappdata(obj,'PrintCallbackInfo',pci);
|
| | 24 | c = onCleanup(@() rmappdata(obj,'PrintCallbackInfo'));
|
| | 25 |
|
| | 26 | cb = get(behavior,callbackName);
|
| | 27 | if isa(cb,'function_handle')
|
| | 28 | cb(handle(obj),callbackName);
|
| | 29 | elseif iscell(cb)
|
| | 30 | if length(cb) > 1
|
| | 31 | feval(cb{1},handle(obj),callbackName,cb{2:end});
|
| | 32 | else
|
| | 33 | feval(cb{1},handle(obj),callbackName);
|
| | 34 | end
|
| | 35 | else
|
| | 36 | feval(cb,handle(obj),callbackName);
|
| | 37 | end
|
| | 38 | end
|
< 0.001 | 4 | 39 | end
|
< 0.001 | 4 | 40 | end
|
< 0.001 | 2 | 41 | end
|
Other subfunctions in this file are not included in this listing.