Mercurial > octave
changeset 24423:1d52db450db4
Change ishandle to return true for Java objects for Matlab compatibility.
Add new function isgraphics() for Matlab compatibility.
Change over existing instances of ishandle to ishghandle.
* NEWS: Announce changes.
* scripts/plot/util/isgraphics.m: New function.
* scripts/plot/util/ishandle.m: New function.
* scripts/plot/util/module.mk: Add isgraphics.m and ishandle.m to build system.
* plot.txi: Change documentation around ishandle. Add isgraphics DOCSTRING to
manual.
* graphics.cc (Fishghandle): Rename function from ishandle to ishghandle. Add
seealso links in docstring.
* graphics.cc: Rename all instances of is_handle to is_hghandle.
* genpropdoc.m, voronoi.m, guidata.m, guihandles.m,
__uiobject_split_args__.m, uibuttongroup.m, uicontrol.m, uiwait.m, waitbar.m,
brighten.m, delete.m, getappdata.m, isappdata.m, rmappdata.m, setappdata.m,
__clabel__.m, camlookat.m, clabel.m, legend.m, material.m, thetaticks.m,
whitebg.m, camlight.m, colorbar.m, isocolors.m, isonormals.m, plotmatrix.m,
plotyy.m, reducepatch.m, shrinkfaces.m, __actual_axis_position__.m,
__opengl_info__.m, __plt_get_axis_arg__.m, ancestor.m, copyobj.m, findobj.m,
hdl2struct.m, hgsave.m, hold.m, isaxes.m, isfigure.m, ishold.m, isprop.m,
linkprop.m, newplot.m, print.m, __gnuplot_draw_axes__.m,
__gnuplot_draw_figure__.m, rotate.m, saveas.m, struct2hdl.m, subplot.m:
Replace instances of ishandle with ishghandle in existing code.
line wrap: on
line diff
--- a/NEWS Sat Dec 16 18:41:41 2017 -0800 +++ b/NEWS Sun Dec 17 07:04:31 2017 -0800 @@ -69,6 +69,11 @@ ** An initial implementation of alpha transparency has been made for patch and surface objects. Printing to svg and pdf is supported. + ** ishandle now returns true for both graphics handle objects and + Java objects. The latter change was made for Matlab compatibility. + Use ishghandle or isgraphics if it is important not to include Java + objects. + ** The following statistical functions have been moved from core Octave to the statistics package available from Octave Forge. @@ -92,6 +97,7 @@ integral integral2 integral3 + isgraphics openvar quad2d repelem
--- a/doc/interpreter/genpropdoc.m Sat Dec 16 18:41:41 2017 -0800 +++ b/doc/interpreter/genpropdoc.m Sun Dec 17 07:04:31 2017 -0800 @@ -1635,7 +1635,7 @@ function s = getstructure (objname, base = []) hf = []; if (! strcmp (objname, "root")) - ## Use an improbable number to avoid ishandle to return true for 1 + ## Use an improbable number to avoid ishghandle to return true for 1 hf = figure (2265465, "visible", "off"); endif @@ -1705,7 +1705,7 @@ def = get (h, field); ## Don't print default values for graphics handles - if (isscalar (def) && def != 0 && ishandle (def)) + if (isscalar (def) && def != 0 && ishghandle (def)) def = ""; else if (ischar (def))
--- a/doc/interpreter/plot.txi Sat Dec 16 18:41:41 2017 -0800 +++ b/doc/interpreter/plot.txi Sun Dec 17 07:04:31 2017 -0800 @@ -1182,11 +1182,13 @@ @code{surface}, @code{image}, and @code{light} objects. Graphics handles may be distinguished from function handles -(@pxref{Function Handles}) by means of the function @code{ishandle}. -@code{ishandle} returns true if its argument is a handle of a graphics object. +(@pxref{Function Handles}) by means of the function @code{ishghandle}. +@code{ishghandle} returns true if its argument is a handle of a graphics object. In addition, a figure or axes object may be tested using @code{isfigure} or -@code{isaxes} respectively. The test functions return true only if the -argument is both a handle and of the correct type (figure or axes). +@code{isaxes} respectively. To test for a specific type of graphics handle, +such as a patch or line object, use @code{isgraphics}. The more specific test +functions return true only if the argument is both a graphics handle and of the +correct type (figure, axes, specified object type). The @code{whos} function can be used to show the object type of each currently defined graphics handle. (Note: this is not true today, but it is, I hope, @@ -1352,13 +1354,15 @@ @cindex handle functions To determine whether a variable is a graphics object index, or an index -to an axes or figure, use the functions @code{ishandle}, @code{isaxes}, and -@code{isfigure}. +to an axes or figure, use the functions @code{ishghandle}, @code{isgraphics}, +@code{isaxes}, and @code{isfigure}. + +@DOCSTRING(ishghandle) + +@DOCSTRING(isgraphics) @DOCSTRING(ishandle) -@DOCSTRING(ishghandle) - @DOCSTRING(isaxes) @DOCSTRING(isfigure)
--- a/libinterp/corefcn/graphics.cc Sat Dec 16 18:41:41 2017 -0800 +++ b/libinterp/corefcn/graphics.cc Sun Dec 17 07:04:31 2017 -0800 @@ -2913,13 +2913,13 @@ } static bool -is_handle (const graphics_handle& h) +is_hghandle (const graphics_handle& h) { return h.ok (); } static bool -is_handle (double val) +is_hghandle (double val) { graphics_handle h = gh_manager::lookup (val); @@ -2927,11 +2927,11 @@ } static octave_value -is_handle (const octave_value& val) +is_hghandle (const octave_value& val) { octave_value retval = false; - if (val.is_real_scalar () && is_handle (val.double_value ())) + if (val.is_real_scalar () && is_hghandle (val.double_value ())) retval = true; else if (val.isnumeric () && val.isreal ()) { @@ -2940,7 +2940,7 @@ boolNDArray result (handles.dims ()); for (octave_idx_type i = 0; i < handles.numel (); i++) - result.xelem (i) = is_handle (handles(i)); + result.xelem (i) = is_hghandle (handles(i)); retval = result; } @@ -3645,7 +3645,7 @@ callbackobject = val; } - else if (is_handle (val)) + else if (is_hghandle (val)) { if (get_callbackobject ().ok ()) cbo_stack.push_front (get_callbackobject ()); @@ -3661,7 +3661,7 @@ { graphics_handle val (v); - if (octave::math::isnan (val.value ()) || is_handle (val)) + if (octave::math::isnan (val.value ()) || is_hghandle (val)) { currentfigure = val; @@ -3819,7 +3819,7 @@ { graphics_handle hax (val); - if (octave::math::isnan (hax.value ()) || is_handle (hax)) + if (octave::math::isnan (hax.value ()) || is_hghandle (hax)) currentaxes = hax; else err_set_invalid ("currentaxes"); @@ -10515,15 +10515,15 @@ // --------------------------------------------------------------------- -DEFUN (ishandle, args, , +DEFUN (ishghandle, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} ishandle (@var{h}) +@deftypefn {} {} ishghandle (@var{h}) Return true if @var{h} is a graphics handle and false otherwise. @var{h} may also be a matrix of handles in which case a logical array is returned that is true where the elements of @var{h} are graphics handles and false where they are not. -@seealso{isaxes, isfigure} +@seealso{isgraphics, isaxes, isfigure, ishandle} @end deftypefn */) { gh_manager::auto_lock guard; @@ -10531,8 +10531,27 @@ if (args.length () != 1) print_usage (); - return ovl (is_handle (args(0))); -} + return ovl (is_hghandle (args(0))); +} + +/* +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! assert (ishghandle (hf)); +%! assert (! ishghandle (-hf)); +%! ax = gca; +%! l = line; +%! assert (ishghandle (ax)); +%! assert (! ishghandle (-ax)); +%! assert (ishghandle ([l, -1, ax, hf]), logical ([1, 0, 1, 1])); +%! assert (ishghandle ([l, -1, ax, hf]'), logical ([1, 0, 1, 1]')); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!assert (ishghandle ([-1 0]), [false true]) +*/ static bool is_handle_visible (const graphics_handle& h)
--- a/scripts/geometry/voronoi.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/geometry/voronoi.m Sun Dec 17 07:04:31 2017 -0800 @@ -68,7 +68,7 @@ narg = 1; hax = NaN; - if (isscalar (varargin{1}) && ishandle (varargin{1})) + if (isscalar (varargin{1}) && ishghandle (varargin{1})) hax = varargin{1}; if (! isaxes (hax)) error ("voronoi: HAX argument must be an axes object");
--- a/scripts/gui/guidata.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/guidata.m Sun Dec 17 07:04:31 2017 -0800 @@ -39,7 +39,7 @@ print_usage (); endif - if (! ishandle (h)) + if (! ishghandle (h)) error ("guidata: H must be a valid object handle"); endif h = ancestor (h, "figure");
--- a/scripts/gui/guihandles.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/guihandles.m Sun Dec 17 07:04:31 2017 -0800 @@ -42,7 +42,7 @@ endif if (nargin == 1) - if (! ishandle (h)) + if (! ishghandle (h)) error ("guidata: H must be a valid object handle"); endif h = ancestor (h, "figure");
--- a/scripts/gui/private/__uiobject_split_args__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/private/__uiobject_split_args__.m Sun Dec 17 07:04:31 2017 -0800 @@ -30,7 +30,7 @@ offset = 1; if (! isempty (in_args)) - if (ishandle (in_args{1})) + if (ishghandle (in_args{1})) parent = in_args{1}; offset = 2; elseif (! ischar (in_args{1})) @@ -48,7 +48,7 @@ i = find (strcmpi (args(1:2:end), "parent"), 1, "first"); if (! isempty (i) && length (args) >= 2*i) parent = args{2*i}; - if (! ishandle (parent)) + if (! ishghandle (parent)) error ("%s: invalid parent handle.", who); endif args([2*i-1, 2*i]) = [];
--- a/scripts/gui/uibuttongroup.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/uibuttongroup.m Sun Dec 17 07:04:31 2017 -0800 @@ -64,7 +64,7 @@ function hui = uibuttongroup (varargin) - if (nargin == 1 && ishandle (varargin{1}) + if (nargin == 1 && ishghandle (varargin{1}) && strcmpi (get (varargin{1}, "type"), "uibuttongroup")) error ("uibuttongroup: focusing not implemented yet"); endif
--- a/scripts/gui/uicontrol.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/uicontrol.m Sun Dec 17 07:04:31 2017 -0800 @@ -100,7 +100,7 @@ function hui = uicontrol (varargin) - if (nargin == 1 && ishandle (varargin{1}) + if (nargin == 1 && ishghandle (varargin{1}) && strcmpi (get (varargin{1}, "type"), "uicontrol")) error ("uicontrol: focusing not implemented yet"); endif
--- a/scripts/gui/uiwait.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/uiwait.m Sun Dec 17 07:04:31 2017 -0800 @@ -71,7 +71,7 @@ endif waitfor (waitfor_args{:}); unwind_protect_cleanup - if (ishandle (h) && isprop (h, "__uiwait_state__")) + if (ishghandle (h) && isprop (h, "__uiwait_state__")) set (h, "__uiwait_state__", "none"); endif end_unwind_protect
--- a/scripts/gui/waitbar.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/gui/waitbar.m Sun Dec 17 07:04:31 2017 -0800 @@ -65,7 +65,7 @@ endif ## Use existing waitbar if it still points to a valid graphics handle. - if (nargin == 1 && ishandle (curr_waitbar)) + if (nargin == 1 && ishghandle (curr_waitbar)) hf = curr_waitbar; else hf = false; @@ -264,7 +264,7 @@ %! "createcancelbtn", "setappdata (gcbf,'interrupt', true)"); %! for ii = 1:niter %! ## Check cancel request -%! if (! ishandle (hf)) +%! if (! ishghandle (hf)) %! break; %! elseif (getappdata (hf, "interrupt")) %! delete (hf); @@ -292,7 +292,7 @@ %! pause (0.5); %! endfor %! -%! if (ishandle (hf)) +%! if (ishghandle (hf)) %! delete (hf); %! endif
--- a/scripts/image/brighten.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/image/brighten.m Sun Dec 17 07:04:31 2017 -0800 @@ -49,7 +49,7 @@ m = colormap (); h = gcf (); else - if (ishandle (arg1)) + if (ishghandle (arg1)) h = arg1; m = get (h, "colormap"); elseif (iscolormap (arg1)) @@ -70,7 +70,7 @@ endif if (nargout == 0) - if (ishandle (h)) + if (ishghandle (h)) set (h, "colormap", m .^ gamma); else colormap (m .^ gamma);
--- a/scripts/miscellaneous/delete.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/miscellaneous/delete.m Sun Dec 17 07:04:31 2017 -0800 @@ -55,7 +55,7 @@ endfor endfor - elseif (isscalar (varargin) && all (ishandle (varargin{1}(:)))) + elseif (isscalar (varargin) && all (ishghandle (varargin{1}(:)))) ## Delete a graphics object. __go_delete__ (varargin{1});
--- a/scripts/miscellaneous/getappdata.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/miscellaneous/getappdata.m Sun Dec 17 07:04:31 2017 -0800 @@ -38,7 +38,7 @@ print_usage (); endif - if (! all (ishandle (h(:)))) + if (! all (ishghandle (h(:)))) error ("getappdata: H must be a scalar or vector of graphic handles"); endif
--- a/scripts/miscellaneous/isappdata.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/miscellaneous/isappdata.m Sun Dec 17 07:04:31 2017 -0800 @@ -34,7 +34,7 @@ print_usage (); endif - if (! all (ishandle (h(:)))) + if (! all (ishghandle (h(:)))) error ("isappdata: H must be a scalar or vector of graphic handles"); elseif (! ischar (name)) error ("isappdata: NAME must be a string");
--- a/scripts/miscellaneous/rmappdata.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/miscellaneous/rmappdata.m Sun Dec 17 07:04:31 2017 -0800 @@ -38,7 +38,7 @@ endif h = h(:).'; - if (! all (ishandle (h))) + if (! all (ishghandle (h))) error ("rmappdata: H must be a scalar or vector of graphic handles"); elseif (! iscellstr (varargin)) error ("rmappdata: NAME must be a string");
--- a/scripts/miscellaneous/setappdata.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/miscellaneous/setappdata.m Sun Dec 17 07:04:31 2017 -0800 @@ -35,7 +35,7 @@ function setappdata (h, varargin) h = h(:).'; - if (! all (ishandle (h))) + if (! all (ishghandle (h))) error ("setappdata: H must be a scalar or vector of graphic handles"); elseif (mod (numel (varargin), 2) != 0) error ("setappdata: NAME/VALUE arguments must occur in pairs");
--- a/scripts/plot/appearance/__clabel__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/__clabel__.m Sun Dec 17 07:04:31 2017 -0800 @@ -32,7 +32,7 @@ xspacing = axpos(3) / (lims(2) - lims (1)); yspacing = axpos(4) / (lims(4) - lims (3)); - if (isscalar (hparent) && ishandle (hparent) + if (isscalar (hparent) && ishghandle (hparent) && strcmp (get (hparent, "type"), "hggroup")) x = get (hparent, "xdata"); xmin = min (x(:));
--- a/scripts/plot/appearance/camlookat.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/camlookat.m Sun Dec 17 07:04:31 2017 -0800 @@ -58,7 +58,7 @@ if (isaxes (hh)) hax = hh; hh = get (hax, "children"); - elseif (all (ishandle (hh))) + elseif (all (ishghandle (hh))) hax = ancestor (hh, "axes"); if numel (hax) > 1 hax = unique ([hax{:}]); @@ -77,7 +77,7 @@ for i = 1:numel (hh) h = hh(i); - if (! ishandle (h)) + if (! ishghandle (h)) error ("camlookat: Inputs must be handles."); end
--- a/scripts/plot/appearance/clabel.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/clabel.m Sun Dec 17 07:04:31 2017 -0800 @@ -73,7 +73,7 @@ hparent = gca (); else arg = varargin{1}; - if (isscalar (arg) && ishandle (arg) + if (isscalar (arg) && ishghandle (arg) && strcmp (get (arg, "type"), "hggroup")) try get (arg, "contourmatrix");
--- a/scripts/plot/appearance/legend.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/legend.m Sun Dec 17 07:04:31 2017 -0800 @@ -118,7 +118,7 @@ function [hleg, hleg_obj, hplot, labels] = legend (varargin) if (nargin > 0 - && (! ishandle (varargin{1}) + && (! ishghandle (varargin{1}) || (strcmp (get (varargin{1}, "type"), "axes") && ! strcmp (get (varargin{1}, "tag"), "legend")))) [ca, varargin, nargin] = __plt_get_axis_arg__ ("legend", varargin{:}); @@ -135,13 +135,13 @@ endif ## Special handling for plotyy which has two axes objects - if (ishandle (ca) && isprop (ca, "__plotyy_axes__")) + if (ishghandle (ca) && isprop (ca, "__plotyy_axes__")) plty = get (ca, "__plotyy_axes__"); - if (isscalar (plty) && ishandle (plty)) + if (isscalar (plty) && ishghandle (plty)) ca = [ca, plty]; elseif (iscell (plty)) ca = [ca, plty{:}]; - elseif (all (ishandle (plty))) + elseif (all (ishghandle (plty))) ca = [ca, plty(:).']; else error ("legend.m: This should not happen. File a bug report."); @@ -151,7 +151,7 @@ ca = ca(sort (n)); endif - if (nargin > 0 && all (ishandle (varargin{1}))) + if (nargin > 0 && all (ishghandle (varargin{1}))) kids = flipud (varargin{1}(:)); varargin(1) = []; else @@ -1169,13 +1169,13 @@ endif endfor - if (ishandle (t1)) + if (ishghandle (t1)) set (t1, "deletefcn", ""); delete (t1); endif for i = 1 : numel (hplots) - if (ishandle (hplots(i)) && strcmp (get (hplots(i), "type"), "line")) + if (ishghandle (hplots(i)) && strcmp (get (hplots(i), "type"), "line")) dellistener (hplots(i), "color"); dellistener (hplots(i), "linestyle"); dellistener (hplots(i), "linewidth");
--- a/scripts/plot/appearance/material.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/material.m Sun Dec 17 07:04:31 2017 -0800 @@ -82,7 +82,7 @@ h = []; if (nargout == 0) ## Check whether first argument is list of graphics handles. - if (all (ishandle (varargin{1}))) + if (all (ishghandle (varargin{1}))) h = varargin{1}; varargin(1) = []; endif
--- a/scripts/plot/appearance/thetaticks.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/thetaticks.m Sun Dec 17 07:04:31 2017 -0800 @@ -65,7 +65,7 @@ endif case 2 - if (! ishandle (varargin{1})) + if (! ishghandle (varargin{1})) error ("thetaticks: HAX must be a handle to an axes object"); endif hax = varargin{1};
--- a/scripts/plot/appearance/whitebg.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/appearance/whitebg.m Sun Dec 17 07:04:31 2017 -0800 @@ -66,7 +66,7 @@ have_fig = false; if (nargin > 0) - if (all (ishandle (varargin{1}))) + if (all (ishghandle (varargin{1}))) h = varargin{1}; have_fig = true; if (nargin == 2)
--- a/scripts/plot/draw/camlight.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/camlight.m Sun Dec 17 07:04:31 2017 -0800 @@ -99,9 +99,9 @@ ## specifying azimuth and a light handle object (also a numeric double). ## We don't worry about that. if (numel (varargin) > 0 && numel (varargin{1}) == 1 - && ishandle (varargin{1})) + && ishghandle (varargin{1})) hl = varargin{1}; - if (! ishghandle (hl, "light")) + if (! isgraphics (hl, "light")) error ("camlight: HL must be a handle to a light object"); endif varargin(1) = [];
--- a/scripts/plot/draw/colorbar.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/colorbar.m Sun Dec 17 07:04:31 2017 -0800 @@ -331,7 +331,7 @@ function update_colorbar_cmap (hf, d, hi, vert, init_sz) persistent sz = init_sz; - if (ishandle (hf) && strcmp (get (hf, "type"), "figure") + if (ishghandle (hf) && strcmp (get (hf, "type"), "figure") && (isempty (gcbf ()) || strcmp (get (gcbf (), "beingdeleted"), "off"))) clen = rows (get (hf, "colormap")); if (clen != sz)
--- a/scripts/plot/draw/isocolors.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/isocolors.m Sun Dec 17 07:04:31 2017 -0800 @@ -94,7 +94,7 @@ if (isnumeric (vp) && columns (vp) == 3) pa = []; v = vp; - elseif (ishghandle (vp, "patch")) + elseif (isgraphics (vp, "patch")) pa = vp; v = get (pa, "Vertices"); else
--- a/scripts/plot/draw/isonormals.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/isonormals.m Sun Dec 17 07:04:31 2017 -0800 @@ -92,7 +92,7 @@ if (isnumeric (vp) && columns (vp) == 3) pa = []; v = vp; - elseif (ishghandle (vp, "patch")) + elseif (isgraphics (vp, "patch")) pa = vp; v = get (pa, "Vertices"); else
--- a/scripts/plot/draw/plotmatrix.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/plotmatrix.m Sun Dec 17 07:04:31 2017 -0800 @@ -121,7 +121,7 @@ if (isaxes (hc) && strcmpi (get (hc, "beingdeleted"), "off")) parent = get (hc, "parent"); ## If the parent is invalid or being deleted, then do nothing - if (ishandle (parent) && strcmpi (get (parent, "beingdeleted"), "off")) + if (ishghandle (parent) && strcmpi (get (parent, "beingdeleted"), "off")) delete (hc); endif endif
--- a/scripts/plot/draw/plotyy.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/plotyy.m Sun Dec 17 07:04:31 2017 -0800 @@ -183,18 +183,18 @@ addlistener (ax(2), "nextplot", {@update_nextplot, ax(1)}); ## Store the axes handles for the sister axes. - if (ishandle (ax(1)) && ! isprop (ax(1), "__plotyy_axes__")) + if (ishghandle (ax(1)) && ! isprop (ax(1), "__plotyy_axes__")) addproperty ("__plotyy_axes__", ax(1), "data"); set (ax(1), "__plotyy_axes__", ax); - elseif (ishandle (ax(1))) + elseif (ishghandle (ax(1))) set (ax(1), "__plotyy_axes__", ax); else error ("plotyy.m: This shouldn't happen. File a bug report."); endif - if (ishandle (ax(2)) && ! isprop (ax(2), "__plotyy_axes__")) + if (ishghandle (ax(2)) && ! isprop (ax(2), "__plotyy_axes__")) addproperty ("__plotyy_axes__", ax(2), "data"); set (ax(2), "__plotyy_axes__", ax); - elseif (ishandle (ax(2))) + elseif (ishghandle (ax(2))) set (ax(2), "__plotyy_axes__", ax); else error ("plotyy.m: This shouldn't happen. File a bug report.");
--- a/scripts/plot/draw/reducepatch.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/reducepatch.m Sun Dec 17 07:04:31 2017 -0800 @@ -181,7 +181,7 @@ endif elseif (isscalar (arg1)) patch_handle = arg1; - if (ishghandle (patch_handle, "patch")) + if (isgraphics (patch_handle, "patch")) vertices = get (patch_handle, "Vertices"); faces = get (patch_handle, "Faces"); else
--- a/scripts/plot/draw/shrinkfaces.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/draw/shrinkfaces.m Sun Dec 17 07:04:31 2017 -0800 @@ -76,7 +76,7 @@ colors = []; p = varargin{1}; - if (isscalar (p) && ishandle (p) && nargin < 3 + if (isscalar (p) && ishghandle (p) && nargin < 3 && strcmp (get (p, "type"), "patch")) faces = get (p, "Faces"); vertices = get (p, "Vertices"); @@ -134,7 +134,7 @@ switch (nargout) case 0 - if (ishandle (p)) + if (ishghandle (p)) ## avoid exceptions set (p, "FaceVertexCData", [], "CData", []); set (p, "Vertices", v, "Faces", f, "FaceVertexCData", c);
--- a/scripts/plot/util/__actual_axis_position__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/__actual_axis_position__.m Sun Dec 17 07:04:31 2017 -0800 @@ -26,7 +26,7 @@ function pos = __actual_axis_position__ (h) - if (ishandle (h)) + if (ishghandle (h)) axis_obj = get (h); elseif (isstruct (h)) axis_obj = h;
--- a/scripts/plot/util/__opengl_info__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/__opengl_info__.m Sun Dec 17 07:04:31 2017 -0800 @@ -78,7 +78,7 @@ info = []; - if (ishandle (h) && strcmp (get (h, "renderer"), "opengl")) + if (ishghandle (h) && strcmp (get (h, "renderer"), "opengl")) vend = get (h, "__gl_vendor__"); if (isempty (vend)) return;
--- a/scripts/plot/util/__plt_get_axis_arg__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/__plt_get_axis_arg__.m Sun Dec 17 07:04:31 2017 -0800 @@ -31,7 +31,7 @@ ## Look for a scalar which is a graphics handle but not the ## Root Figure (0) or an ordinary figure (integer). if (numel (varargin) > 0 && numel (varargin{1}) == 1 - && ishandle (varargin{1}) && varargin{1} != 0 && ! isfigure (varargin{1})) + && ishghandle (varargin{1}) && varargin{1} != 0 && ! isfigure (varargin{1})) htmp = varargin{1}; if (! isaxes (htmp)) error ("%s: first argument must be axes handle", caller); @@ -42,7 +42,7 @@ endif ## Look for "parent"/axis prop/value pair elseif (numel (varargin) > 1 && ! isempty (parent)) - if (parent < numel (varargin) && ishandle (varargin{parent+1})) + if (parent < numel (varargin) && ishghandle (varargin{parent+1})) htmp = varargin{parent+1}; if (isaxes (htmp) && ! strcmp (get (htmp, "tag"), "legend")) h = htmp;
--- a/scripts/plot/util/ancestor.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/ancestor.m Sun Dec 17 07:04:31 2017 -0800 @@ -61,7 +61,7 @@ h = num2cell (h); for nh = 1:numel (h) while (true) - if (isempty (h{nh}) || ! ishandle (h{nh})) + if (isempty (h{nh}) || ! ishghandle (h{nh})) break; endif if (any (strcmpi (get (h{nh}, "type"), type)))
--- a/scripts/plot/util/copyobj.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/copyobj.m Sun Dec 17 07:04:31 2017 -0800 @@ -44,9 +44,9 @@ othertypes = {"line", "patch", "surface", "image", "text"}; alltypes = [partypes othertypes]; - if (! ishandle (horig) || nargin > 2) + if (! ishghandle (horig) || nargin > 2) print_usage (); - elseif (! ishandle (hparent)) + elseif (! ishghandle (hparent)) hparent = figure (fix (hparent)); else for hp = hparent(:)'
--- a/scripts/plot/util/findobj.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/findobj.m Sun Dec 17 07:04:31 2017 -0800 @@ -96,7 +96,7 @@ n1 = 0; else if (! isempty (varargin{1})) - if (ishandle (varargin{1}(1))) + if (ishghandle (varargin{1}(1))) handles = varargin{1}; n1 = 2; else
--- a/scripts/plot/util/hdl2struct.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/hdl2struct.m Sun Dec 17 07:04:31 2017 -0800 @@ -31,7 +31,7 @@ function s = hdl2struct (h) - if (nargin != 1 || ! ishandle (h)) + if (nargin != 1 || ! ishghandle (h)) print_usage (); endif
--- a/scripts/plot/util/hgsave.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/hgsave.m Sun Dec 17 07:04:31 2017 -0800 @@ -65,7 +65,7 @@ if (isempty (h)) error ("hgsave: No current figure to save"); endif - elseif (! (ishandle (h) && ischar (filename))) + elseif (! (ishghandle (h) && ischar (filename))) print_usage (); endif
--- a/scripts/plot/util/hold.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/hold.m Sun Dec 17 07:04:31 2017 -0800 @@ -56,7 +56,7 @@ varargin(1) = []; nargs = numel (varargin); hfig = ancestor (hax, "figure"); - elseif (nargin > 0 && numel (varargin{1}) > 1 && ishandle (varargin{1})) + elseif (nargin > 0 && numel (varargin{1}) > 1 && ishghandle (varargin{1})) print_usage (); else hax = gca ();
--- a/scripts/plot/util/isaxes.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/isaxes.m Sun Dec 17 07:04:31 2017 -0800 @@ -22,7 +22,7 @@ ## ## If @var{h} is a matrix then return a logical array which is true where the ## elements of @var{h} are axes graphics handles and false where they are not. -## @seealso{isaxes, ishandle} +## @seealso{isaxes, ishghandle} ## @end deftypefn ## Author: jwe @@ -33,7 +33,7 @@ print_usage (); endif - hlist = ishandle (h); + hlist = ishghandle (h); retval = hlist; if (any (hlist))
--- a/scripts/plot/util/isfigure.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/isfigure.m Sun Dec 17 07:04:31 2017 -0800 @@ -23,7 +23,7 @@ ## If @var{h} is a matrix then return a logical array which is true where the ## elements of @var{h} are figure graphics handles and false where they are ## not. -## @seealso{isaxes, ishandle} +## @seealso{isaxes, ishghandle} ## @end deftypefn ## Author: jwe @@ -34,7 +34,7 @@ print_usage (); endif - hlist = ishandle (h); + hlist = ishghandle (h); if (any (hlist)) retval(hlist) = strcmp (get (h(hlist), "type"), "figure"); else
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/plot/util/isgraphics.m Sun Dec 17 07:04:31 2017 -0800 @@ -0,0 +1,106 @@ +## Copyright (C) 2008-2017 David Bateman +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or +## (at your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {} {} isgraphics (@var{h}) +## @deftypefnx {} {} isgraphics (@var{h}, @var{type}) +## Return true if @var{h} is a graphics handle (of type @var{type}) and false +## otherwise. +## +## When no @var{type} is specified the function is equivalent to +## @code{ishghandle}. +## @seealso{ishghandle, ishandle} +## @end deftypefn + +function retval = isgraphics (h, type = "") + + if (nargin < 1 || nargin > 2) + print_usage (); + endif + + if (nargin == 2 && (! ischar (type) || ! isrow (type))) + error ("isgraphics: TYPE must be a string"); + endif + + ## Octave has no Simulink equivalent so it is sufficient to call ishghandle. + retval = ishghandle (h); + + if (nargin == 2 && any (retval)) + typematch = strcmpi (get (h(retval), "type"), type); + retval(retval) = typematch; + endif + +endfunction + + +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! assert (isgraphics (hf)); +%! assert (isgraphics (hf, "figure")); +%! assert (! isgraphics (-hf)); +%! assert (! isgraphics (hf, "foo")); +%! l = line; +%! ax = gca; +%! assert (isgraphics (ax)); +%! assert (isgraphics (ax, "axes")); +%! assert (! isgraphics (-ax)); +%! assert (! isgraphics (ax, "foo")); +%! assert (isgraphics (l)); +%! assert (isgraphics (l, "line")); +%! assert (! isgraphics (-l)); +%! assert (! isgraphics (l, "foo")); +%! p = patch; +%! assert (isgraphics (p)); +%! assert (isgraphics (p, "patch")); +%! assert (! isgraphics (-p)); +%! assert (! isgraphics (p, "foo")); +%! s = surface; +%! assert (isgraphics (s)); +%! assert (isgraphics (s, "surface")); +%! assert (! isgraphics (-s)); +%! assert (! isgraphics (s, "foo")); +%! t = text; +%! assert (isgraphics (t)); +%! assert (isgraphics (t, "text")); +%! assert (! isgraphics (-t)); +%! assert (! isgraphics (t, "foo")); +%! i = image ([1]); +%! assert (isgraphics (i)); +%! assert (isgraphics (i, "image")); +%! assert (! isgraphics (-i)); +%! assert (! isgraphics (i, "foo")); +%! hg = hggroup; +%! assert (isgraphics (hg)); +%! assert (isgraphics (hg, "hggroup")); +%! assert (! isgraphics (-hg)); +%! assert (! isgraphics (hg, "foo")); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!test +%! assert (isgraphics ([-1 0]), [false true]); +%! assert (isgraphics ([-1 0], "root"), [false true]); +%! assert (isgraphics ([-1 0], "foobar"), [false false]); + +## Test input validation +%!error isgraphics () +%!error isgraphics (1, 2, 3) +%!error <TYPE must be a string> isgraphics (0, 1) +%!error <TYPE must be a string> isgraphics (0, {1})
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/plot/util/ishandle.m Sun Dec 17 07:04:31 2017 -0800 @@ -0,0 +1,69 @@ +## Copyright (C) 2017 Rik Wehbring +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or +## (at your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn {} {} ishandle (@var{h}) +## Return true if @var{h} is a handle to a graphics or Java object and false +## otherwise. +## +## @var{h} may also be a matrix of handles in which case a logical array is +## returned that is true where the elements of @var{h} are handles to graphics +## or Java objects and false where they are not. +## +## Programming Note: It is often more useful to test for a specific object +## type. To determine if a handle belongs to a graphics object use +## @code{ishghandle} or @code{isgraphics}. To determine if a handle belongs +## to a Java object use @code{isjava}. +## @seealso{ishghandle, isgraphics, isjava} +## @end deftypefn + +function retval = ishandle (h) + + if (nargin != 1) + print_usage (); + endif + + retval = ishghandle (h) | isjava (h); + +endfunction + + +%!test +%! hf = figure ("visible", "off"); +%! unwind_protect +%! assert (ishandle (hf)); +%! assert (! ishandle (-hf)); +%! ax = gca; +%! l = line; +%! assert (ishandle (ax)); +%! assert (! ishandle (-ax)); +%! assert (ishandle ([l, -1, ax, hf]), logical ([1, 0, 1, 1])); +%! assert (ishandle ([l, -1, ax, hf]'), logical ([1, 0, 1, 1]')); +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect + +%!assert (ishandle ([-1 0]), [false true]) + +%!testif HAVE_JAVA; usejava ("jvm") +%! jobj = javaObject ("java.lang.Double", 1.0); +%! assert (ishandle (jobj)); + +## Test input validation +%!error ishandle () +%!error ishandle (1, 2)
--- a/scripts/plot/util/ishghandle.m Sat Dec 16 18:41:41 2017 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -## Copyright (C) 2008-2017 David Bateman -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or -## (at your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {} {} ishghandle (@var{h}) -## @deftypefnx {} {} ishghandle (@var{h}, @var{type}) -## Return true if @var{h} is a graphics handle (of type @var{type}) and false -## otherwise. -## -## When no @var{type} is specified the function is equivalent to -## @code{ishandle}. -## @seealso{ishandle} -## @end deftypefn - -function retval = ishghandle (h, type = "") - - if (nargin < 1 || nargin > 2) - print_usage (); - endif - - if (nargin == 2 && (! ischar (type) || ! isrow (type))) - error ("ishghandle: TYPE must be a string"); - endif - - ## Octave has no Simulink equivalent so it is sufficient to call ishandle. - retval = ishandle (h); - - if (nargin == 2 && any (retval)) - typematch = strcmpi (get (h(retval), "type"), type); - retval(retval) = typematch; - endif - -endfunction - - -%!test -%! hf = figure ("visible", "off"); -%! unwind_protect -%! assert (ishghandle (hf)); -%! assert (ishghandle (hf, "figure")); -%! assert (! ishghandle (-hf)); -%! assert (! ishghandle (hf, "foo")); -%! l = line; -%! ax = gca; -%! assert (ishghandle (ax)); -%! assert (ishghandle (ax, "axes")); -%! assert (! ishghandle (-ax)); -%! assert (! ishghandle (ax, "foo")); -%! assert (ishghandle (l)); -%! assert (ishghandle (l, "line")); -%! assert (! ishghandle (-l)); -%! assert (! ishghandle (l, "foo")); -%! p = patch; -%! assert (ishghandle (p)); -%! assert (ishghandle (p, "patch")); -%! assert (! ishghandle (-p)); -%! assert (! ishghandle (p, "foo")); -%! s = surface; -%! assert (ishghandle (s)); -%! assert (ishghandle (s, "surface")); -%! assert (! ishghandle (-s)); -%! assert (! ishghandle (s, "foo")); -%! t = text; -%! assert (ishghandle (t)); -%! assert (ishghandle (t, "text")); -%! assert (! ishghandle (-t)); -%! assert (! ishghandle (t, "foo")); -%! i = image ([1]); -%! assert (ishghandle (i)); -%! assert (ishghandle (i, "image")); -%! assert (! ishghandle (-i)); -%! assert (! ishghandle (i, "foo")); -%! hg = hggroup; -%! assert (ishghandle (hg)); -%! assert (ishghandle (hg, "hggroup")); -%! assert (! ishghandle (-hg)); -%! assert (! ishghandle (hg, "foo")); -%! unwind_protect_cleanup -%! close (hf); -%! end_unwind_protect - -%!test -%! assert (ishghandle ([-1 0]), [false true]); -%! assert (ishghandle ([-1 0], "root"), [false true]); -%! assert (ishghandle ([-1 0], "foobar"), [false false]); - -## Test input validation -%!error ishghandle () -%!error ishghandle (1, 2, 3) -%!error <TYPE must be a string> ishghandle (0, 1) -%!error <TYPE must be a string> ishghandle (0, {1})
--- a/scripts/plot/util/ishold.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/ishold.m Sun Dec 17 07:04:31 2017 -0800 @@ -38,7 +38,7 @@ fig = gcf (); ax = get (fig, "currentaxes"); else - if (! ishandle (h)) + if (! ishghandle (h)) error ("ishold: H must be an axes or figure graphics handle"); endif
--- a/scripts/plot/util/isprop.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/isprop.m Sun Dec 17 07:04:31 2017 -0800 @@ -40,7 +40,7 @@ res = false (size (obj)); for i = 1:numel (res) - if (ishandle (obj(i))) + if (ishghandle (obj(i))) try v = get (obj(i), prop); res(i) = true;
--- a/scripts/plot/util/linkprop.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/linkprop.m Sun Dec 17 07:04:31 2017 -0800 @@ -62,7 +62,7 @@ if (numel (h) < 2) error ("linkprop: H must contain at least 2 handles"); - elseif (! all (ishandle (h(:)))) + elseif (! all (ishghandle (h(:)))) error ("linkprop: invalid graphic handle in input H"); endif @@ -97,7 +97,7 @@ if (! recursion) unwind_protect recursion = true; - set (hlist(ishandle (hlist)), prop, get (h, prop)); + set (hlist(ishghandle (hlist)), prop, get (h, prop)); unwind_protect_cleanup recursion = false; end_unwind_protect @@ -108,7 +108,7 @@ function delete_linkprop (hlist, prop) for i = 1 : numel (hlist) - if (ishandle (hlist(i))) + if (ishghandle (hlist(i))) for j = 1 : numel (prop) dellistener (hlist(i), prop{j}); endfor
--- a/scripts/plot/util/module.mk Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/module.mk Sun Dec 17 07:04:31 2017 -0800 @@ -60,7 +60,8 @@ %reldir%/hold.m \ %reldir%/isaxes.m \ %reldir%/isfigure.m \ - %reldir%/ishghandle.m \ + %reldir%/isgraphics.m \ + %reldir%/ishandle.m \ %reldir%/ishold.m \ %reldir%/isprop.m \ %reldir%/linkaxes.m \
--- a/scripts/plot/util/newplot.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/newplot.m Sun Dec 17 07:04:31 2017 -0800 @@ -244,7 +244,7 @@ %! li2 = line (1:10, sin (1:10), "parent", hg2); %! hold off; %! newplot (hg2); -%! assert (ishandle (li0), false); +%! assert (ishghandle (li0), false); %! assert (get (hax, "children"), hg1); %! %! ## kids are preserved for hggroups @@ -254,7 +254,7 @@ %! %! ## preserve objects %! newplot (li1); -%! assert (ishandle (li1)); +%! assert (ishghandle (li1)); %! %! ## kids are deleted for axes %! newplot (hax);
--- a/scripts/plot/util/print.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/print.m Sun Dec 17 07:04:31 2017 -0800 @@ -485,7 +485,7 @@ h = setdiff (h, hnone); m = numel (props); for n = 1:numel (h) - if (ishandle (h(n))) + if (ishghandle (h(n))) ## Need to verify objects exist since callbacks may delete objects ## as the colors for others are modified. rgb = get (h(n), color_props{c}); @@ -507,14 +507,14 @@ h = findall (opts.figure, "-property", "fontname"); m = numel (props); for n = 1:numel (h) - if (ishandle (h(n))) + if (ishghandle (h(n))) if (! isempty (opts.font)) props(end+1).h = h(n); props(end).name = "fontname"; props(end).value = {get(h(n), "fontname")}; endif endif - if (ishandle (h(n))) + if (ishghandle (h(n))) if (! isempty (opts.fontsize)) props(end+1).h = h(n); props(end).name = "fontsize"; @@ -523,7 +523,7 @@ endif endfor if (! isempty (opts.font)) - set (h(ishandle (h)), "fontname", opts.font); + set (h(ishghandle (h)), "fontname", opts.font); endif if (! isempty (opts.fontsize)) if (ischar (opts.fontsize)) @@ -537,7 +537,7 @@ endif ## FIXME: legend child objects need to be acted on first. ## or legend fontsize callback will destroy them. - hlist = h(ishandle (h)); + hlist = h(ishghandle (h)); haxes = strcmp (get (hlist, "type"), "axes"); set (hlist(! haxes), "fontsize", fontsize); set (hlist(haxes), "fontsize", fontsize); @@ -557,12 +557,12 @@ if (isstruct (props)) ## Restore figure position and units first for n = nfig:-1:1 - if (ishandle (props(n).h)) + if (ishghandle (props(n).h)) set (props(n).h, props(n).name, props(n).value{1}); endif endfor for n = numel (props):-1:(nfig + 1) - if (ishandle (props(n).h)) + if (ishghandle (props(n).h)) set (props(n).h, props(n).name, props(n).value{1}); endif endfor
--- a/scripts/plot/util/private/__gnuplot_draw_axes__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/private/__gnuplot_draw_axes__.m Sun Dec 17 07:04:31 2017 -0800 @@ -40,11 +40,11 @@ ## Set to false for plotyy axes. ymirror = true; if (isfield (axis_obj, "__plotyy_axes__")) - if (all (ishandle (axis_obj.__plotyy_axes__))) + if (all (ishghandle (axis_obj.__plotyy_axes__))) ymirror = false; else h = axis_obj.__plotyy_axes__; - h = h(ishandle (h)); + h = h(ishghandle (h)); h = h(isprop (h, "__plotyy_axes__")); rmappdata (h, "__plotyy_axes__"); endif
--- a/scripts/plot/util/private/__gnuplot_draw_figure__.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/private/__gnuplot_draw_figure__.m Sun Dec 17 07:04:31 2017 -0800 @@ -158,7 +158,7 @@ hlegend = []; fkids = get (h, "children"); for j = 1 : numel (fkids) - if (ishandle (fkids (j)) + if (ishghandle (fkids (j)) && strcmp (get (fkids (j), "type"), "axes") && (strcmp (get (fkids (j), "tag"), "legend"))) udata = get (fkids (j), "userdata");
--- a/scripts/plot/util/rotate.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/rotate.m Sun Dec 17 07:04:31 2017 -0800 @@ -42,7 +42,7 @@ print_usage (); endif - is_h = ishandle (h); + is_h = ishghandle (h); if (is_h) ax_list = get (h, "parent"); if (iscell (ax_list))
--- a/scripts/plot/util/saveas.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/saveas.m Sun Dec 17 07:04:31 2017 -0800 @@ -69,7 +69,7 @@ print_usage (); endif - if (! ishandle (h)) + if (! ishghandle (h)) error ("saveas: H must be a graphics handle"); endif if (! ischar (filename))
--- a/scripts/plot/util/struct2hdl.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/struct2hdl.m Sun Dec 17 07:04:31 2017 -0800 @@ -51,7 +51,7 @@ elseif (! all (isfield (s, fields))) print_usage (); elseif (isscalar (p)) - if (! ishandle (p)) + if (! ishghandle (p)) error ("struct2hdl: P is not a handle to a graphic object"); endif if (any (strcmp (get (p).type, partypes)))
--- a/scripts/plot/util/subplot.m Sat Dec 16 18:41:41 2017 -0800 +++ b/scripts/plot/util/subplot.m Sun Dec 17 07:04:31 2017 -0800 @@ -232,7 +232,7 @@ ## case anymore due to the deletion of previous children (due to ## "deletefcn" callback or for legends/colorbars that are deleted ## with their corresponding axes). - if (! ishandle (child)) + if (! ishghandle (child)) continue; endif if (strcmp (get (child, "type"), "axes")) @@ -579,7 +579,7 @@ %! subplot (3,3,1); %! assert (gca (), hax(1)); %! subplot (2,1,1); -%! assert (ishandle (hax),[false(1,6), true(1,3)]); +%! assert (ishghandle (hax),[false(1,6), true(1,3)]); %! unwind_protect_cleanup %! delete (hf); %! end_unwind_protect @@ -595,7 +595,7 @@ %! subplot ("position", [0.5 0.5 0.3 0.3]); %! assert (gca (), h2); %! subplot ("position", [0.5 0.5 0.3 0.2]); -%! assert (! ishandle (h2)); +%! assert (! ishghandle (h2)); %! unwind_protect_cleanup %! delete (hf); %! end_unwind_protect @@ -609,8 +609,8 @@ %! subplot (3,5,1, "align"); %! assert (gca (), h1); %! subplot (3,2,1, "align"); -%! assert (! ishandle (h1)); -%! assert (! ishandle (h2)); +%! assert (! ishghandle (h1)); +%! assert (! ishghandle (h2)); %! unwind_protect_cleanup %! delete (hf); %! end_unwind_protect