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 | 2 | 17 | hsave = [];
|
< 0.001 | 2 | 18 | do_reset = '';
|
| | 19 |
|
< 0.001 | 2 | 20 | narginchk(1, 3);
|
| | 21 |
|
< 0.001 | 2 | 22 | if nargin > 1
|
< 0.001 | 2 | 23 | if ischar(in1)
|
< 0.001 | 2 | 24 | do_reset = in1;
|
| | 25 | else
|
| | 26 | hsave = in1;
|
< 0.001 | 2 | 27 | end
|
< 0.001 | 2 | 28 | if nargin > 2
|
< 0.001 | 2 | 29 | if ischar(in2)
|
| | 30 | do_reset = in2;
|
< 0.001 | 2 | 31 | else
|
< 0.001 | 2 | 32 | hsave = in2;
|
< 0.001 | 2 | 33 | end
|
< 0.001 | 2 | 34 | end
|
< 0.001 | 2 | 35 | end
|
| | 36 |
|
| | 37 | % error-check input args
|
< 0.001 | 2 | 38 | if ~isempty(do_reset)
|
< 0.001 | 2 | 39 | if ~strcmp(do_reset, 'reset')
|
| | 40 | error(message('MATLAB:clo:unknownOption'))
|
< 0.001 | 2 | 41 | else
|
< 0.001 | 2 | 42 | do_reset = 1;
|
< 0.001 | 2 | 43 | end
|
| | 44 | else
|
| | 45 | do_reset = 0;
|
< 0.001 | 2 | 46 | end
|
| | 47 |
|
< 0.001 | 2 | 48 | if any(~isgraphics(hsave))
|
| | 49 | error(message('MATLAB:clo:invalidHandle'))
|
| | 50 | end
|
| | 51 |
|
< 0.001 | 2 | 52 | obj = handle(obj); % In case of double handle
|
0.005 | 2 | 53 | obj.clo(hsave, (do_reset == 1)); % Call clo method on graphics class
|
Other subfunctions in this file are not included in this listing.