time | Calls | line |
---|
| | 1 | function clo(obj, in1, in2)
|
| | 2 | %CLO Clear object
|
| | 3 | % CLO(H) deletes all children of the object with visible handles.
|
| | 4 | %
|
| | 5 | % CLO(..., 'reset') deletes all children (including ones with hidden
|
| | 6 | % handles) and also resets all object properties to their default
|
| | 7 | % values.
|
| | 8 | %
|
| | 9 | % CLO(..., HSAVE) deletes all children except those specified in
|
| | 10 | % HSAVE.
|
| | 11 | %
|
| | 12 | % See also CLF, CLA, RESET, HOLD.
|
| | 13 |
|
| | 14 | % Copyright 1984-2016 The MathWorks, Inc.
|
| | 15 |
|
| | 16 | % decode input args:
|
< 0.001 | 12 | 17 | hsave = [];
|
< 0.001 | 12 | 18 | do_reset = '';
|
| | 19 |
|
< 0.001 | 12 | 20 | narginchk(1, 3);
|
| | 21 |
|
< 0.001 | 12 | 22 | if nargin > 1
|
< 0.001 | 12 | 23 | if ischar(in1)
|
< 0.001 | 12 | 24 | do_reset = in1;
|
| | 25 | else
|
| | 26 | hsave = in1;
|
< 0.001 | 12 | 27 | end
|
< 0.001 | 12 | 28 | if nargin > 2
|
< 0.001 | 12 | 29 | if ischar(in2)
|
| | 30 | do_reset = in2;
|
< 0.001 | 12 | 31 | else
|
< 0.001 | 12 | 32 | hsave = in2;
|
< 0.001 | 12 | 33 | end
|
< 0.001 | 12 | 34 | end
|
< 0.001 | 12 | 35 | end
|
| | 36 |
|
| | 37 | % error-check input args
|
< 0.001 | 12 | 38 | if ~isempty(do_reset)
|
< 0.001 | 12 | 39 | if ~strcmp(do_reset, 'reset')
|
| | 40 | error(message('MATLAB:clo:unknownOption'))
|
< 0.001 | 12 | 41 | else
|
< 0.001 | 12 | 42 | do_reset = 1;
|
< 0.001 | 12 | 43 | end
|
| | 44 | else
|
| | 45 | do_reset = 0;
|
< 0.001 | 12 | 46 | end
|
| | 47 |
|
< 0.001 | 12 | 48 | if any(~isgraphics(hsave))
|
| | 49 | error(message('MATLAB:clo:invalidHandle'))
|
< 0.001 | 12 | 50 | end
|
| | 51 |
|
< 0.001 | 12 | 52 | obj = handle(obj); % In case of double handle
|
0.035 | 12 | 53 | obj.clo(hsave, (do_reset == 1)); % Call clo method on graphics class
|
Other subfunctions in this file are not included in this listing.