File: %25pltlibH_set.sci

package info (click to toggle)
scilab-plotlib 0.41-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,196 kB
  • sloc: xml: 3,308; makefile: 15
file content (55 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function %pltlibH_set(h,varargin)
  global leafPropertiesNames axesPropertiesNames figurePropertiesNames
  
  if is_handle_valid(h.handle)
    for i=1:size(h.handle,'*')
      typ(i)=typeof(get(h.handle(i),'user_data'));
    end
    if size(unique(typ),'*')>1
      error('set : handles must be of the same type')  
    end 
  else
    error('set : handle is no more valid');
  end
  
  select typ(1)
  case 'figureData'
    propertiesNames=figurePropertiesNames;
    typ='Figure';
    parse=_parse_figure_ppty_value;
    update=_update_figure;
  case 'axesData'
    propertiesNames=axesPropertiesNames;
    typ='Axes'
    parse=_parse_axes_ppty_value;
    update=_update_axes;
  case 'leafData'
    propertiesNames=leafPropertiesNames;
    typ='Leaf';
    parse=_parse_leaf_ppty_value;
    update=_update_leaf;
  else
    propertiesNames=[];
    typ=h.handle.type;
  end
      
  i=1;
  while i<=length(varargin)
    prop=varargin(i);
    if or(convstr(prop)==propertiesNames(1))
      [_ppty_value_list,i]=parse("set",varargin,i);
      for j=1:size(h.handle,'*')
        update(h(j).handle,_ppty_value_list);
      end
    else
      try
         set(h.handle,prop,varargin(i+1));
      catch
        	_error(sprintf('set : %s is an unknown %s property name',prop,typ))     
      end
      i=i+2;
    end
  end  
  
endfunction