function opt=setoption(command, opt) %SETOPTION Set the SelOBj (selected object) properties % % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu % global SelObj Handlefig co=0; if isempty(SelObj) | ~isobj(SelObj) SelObj=gco; co=1; end for i=1:length(SelObj) if strcmp(upper(command), 'LINESTYLE') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'LINE PLOT SURFACE')) set(SelObj(i), 'LineStyle', opt); end end if strcmp(upper(command), 'LINEWIDTH') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'LINE PLOT SURFACE PATCH')) if opt == 0 opt=asknumber(get(SelObj(i), 'LineWidth'), 0.5, 36, 'Line Width'); end set(SelObj(i), 'LineWidth', opt); end end if strcmp(upper(command), 'PENCOLOR') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'LINE PLOT TEXT')) if strcmp(upper(opt), 'DEFINE') opt=definergb(get(SelObj(i), 'Color')); end set(SelObj(i), 'Color', opt); end end if strcmp(upper(command), 'PENCOLOR') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'SURFACE PATCH')) if strcmp(upper(opt), 'DEFINE') opt=definergb(get(SelObj(i), 'EdgeColor')); end set(SelObj(i), 'EdgeColor', opt); end end if strcmp(upper(command), 'FILLCOLOR') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'SURFACE PATCH')) if strcmp(upper(opt), 'DEFINE') opt=definergb(get(SelObj(i), 'FaceColor')); end set(SelObj(i), 'FaceColor', opt); end end if strcmp(upper(command), 'FONTNAME') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'TEXT')) set(SelObj(i), 'FontName', opt); end end if strcmp(upper(command), 'FONTSTYLE') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'TEXT')) if strcmp(upper(opt), 'PLAIN') set(SelObj(i), 'FontWeight', 'Normal', 'FontAngle', 'normal'); else if strcmp(upper(opt), 'ITALIC') | strcmp(upper(opt), 'OBLIQUE') set(SelObj(i), 'FontAngle', opt); else set(SelObj(i), 'FontWeight', opt); end end end end if strcmp(upper(command), 'FONTSIZE') if ~isempty(findstr(upper(get(SelObj(i), 'type')), 'TEXT')) if opt == 0 opt=asknumber(get(SelObj(i), 'FontSize'), 6, 122, 'Font Size'); end set(SelObj(i), 'FontSize', opt); end end end % FOR if co SelObj=[]; end return