0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 % LTPDA_EXPLORER for exploring analysis objects and plotting/displaying their fields
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4 % DESCRIPTION: LTPDA_EXPLORER for exploring analysis objects and plotting/displaying
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 % their fields. It is possible to browse througth the history tree
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 % to see only a part of this tree. If the user will use the plot
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7 % function the plot will be printed in a new figure.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9 % CALL: ltpda_explorer; % Read the ao's from the'base' workspace
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 % ltpda_explorer(ao);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11 % ltpda_explorer(ao_vector);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 % ltpda_explorer(ao_matrix);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15 % VERSION: $Id: ltpda_explorer.m,v 1.13 2011/05/10 04:50:58 hewitson Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17 % HISTORY: 10-06-07 Diepholz
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18 % Creation
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 % NOTE: The idea and the core source code are taken from:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 % Hassan Lahdili (hassan.lahdili@crc.ca)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 % Communications Research Centre (CRC) | Advanced Audio Systems (AAS)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 % www.crc.ca | www.crc.ca/aas
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 % Ottawa. Canada
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 % CRC Advanced Audio Systems - Ottawa 16/02/2005 2004-2005
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 function ltpda_explorer(varargin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 % Define the Positions %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 % figure position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 % FIG_X = .150;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 % FIG_Y = .150;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 % FIG_dX = .700;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 % FIG_dY = .600;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 FONT_SIZE = 13;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 FIG_X = 150;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 FIG_Y = 150;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 FIG_dX = 700;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 FIG_dY = 600;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 % tree position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 TREE_X = .000;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 TREE_Y = .000;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 TREE_dX = .350;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 TREE_dY = 1.000;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 % plot field position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 PLOT_X = .45;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57 PLOT_Y = .15;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58 PLOT_dX = .5;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59 PLOT_dY = .7;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 % display field position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 DISP_X = TREE_X;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 DISP_Y = .750;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64 DISP_dX = TREE_dX;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 DISP_dY = 1-DISP_Y;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 % explorer name position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 EXPL_NAME_dX = .370;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 EXPL_NAME_dY = .045;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70 EXPL_NAME_X = PLOT_X+(PLOT_dX-EXPL_NAME_dX)/2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 EXPL_NAME_Y = .030;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 % EXPL_NAME_Y = .065;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 % info fields position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 N_INFOS = 3;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 INFO_X = PLOT_X;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78 INFO_Y = .915;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 INFO_dX = PLOT_dX / N_INFOS;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 INFO_dY = .06;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 BG_COLOR = [.925 .914 .847];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84 MAX_HIST_DEPTH = 4;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 % Check the input %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 tree_name = 'objects';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 obj = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93 obj_value = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 obj_name = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 % Read the objects from the 'base' workspace
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 if nargin == 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 ws_vars = evalin('base','whos');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 elseif nargin == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102 tmp = varargin{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 if iscell(tmp)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105 ws_vars = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 for jj = 1:length(tmp)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 ws_vars(jj).name = [inputname(1) '{' num2str(jj) '}'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 ws_vars(jj).class = class(tmp{jj});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 ws_vars(jj).obj = tmp{jj};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112 elseif numel(tmp)>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 ws_vars = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 for jj=1:numel(tmp)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 ws_vars(jj).name = [inputname(1) '(' num2str(jj) ')'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116 ws_vars(jj).class = class(tmp(jj));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 ws_vars(jj).obj = tmp(jj);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121 ws_vars = whos('tmp');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122 ws_vars.name = inputname(1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 ws_vars.obj = tmp;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 error ('##########');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 for mm=1:length(ws_vars)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 if nargin == 0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 obj = evalin('base', ws_vars(mm).name);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 elseif nargin == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136 obj = ws_vars(mm).obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 error('#####');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 if utils.helper.isobject(obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 % the object in the workspace is a single value
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 if numel(obj) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 obj_value{end+1} = obj;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146 obj_name{end+1} = [ws_vars(mm).class ':' ws_vars(mm).name];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 [n,m] = size(obj);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 % the ao in the workspace is a vector
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 if n == 1 || m == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 for jj=1:length(obj)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 obj_value{end+1} = obj(jj);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 obj_name{end+1} = [ws_vars(mm).class ':' ws_vars(mm).name '(' num2str(jj) ')'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159 % the ao in the workspace is a matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 elseif n > 1 && m > 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 for gg = 1:n
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 for hh = 1:m
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164 obj_value{end+1} = obj(gg,hh);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 obj_name{end+1} = [ws_vars(mm).class ':' ws_vars(mm).name '(' num2str(gg) ',' num2str(hh) ')'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 error ('### this should not happen.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 fig_name = 'Exploring objects';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 % Define figure
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 fig = figure('NextPlot', 'add', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 'NumberTitle', 'off', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 'Toolbar', 'none', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 'name', fig_name, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 'Color', BG_COLOR, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 'ToolBar', 'none', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 'NextPlot', 'new', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 'MenuBar', 'none',...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 'Position', [FIG_X FIG_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 FIG_dX FIG_dY]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194 % Define the tree %
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 root = uitreenode('v0', tree_name, tree_name, [], false);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 tree = uitree('v0', fig, 'Root',root, 'ExpandFcn', @myExpfcn4);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 set(tree, 'Units', 'normalized')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200 drawnow;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 set(tree, 'position', [TREE_X TREE_Y TREE_dX TREE_dY]); %, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 set(tree, 'NodeWillExpandCallback', @nodeWillExpand_cb4, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 'NodeSelectedCallback', @nodeSelected_cb4);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
204
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
205 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
206 cell_Data = cell(3,1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
207
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
208 % cell_Data{1} = varargin{:};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
209 cell_Data{1} = obj_value;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
210 cell_Data{3} = obj_name;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
211
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
212 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
213 set(tmp, 'UserData', cell_Data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
214 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
215
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
216 % Define the plot field
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
217 haxes = axes('Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
218 'Position', [PLOT_X PLOT_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
219 PLOT_dX PLOT_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
220 'Box', 'on', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
221 'XTick', [], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
222 'YTick', []);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
223
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
224 box off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
225 axis off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
226
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
227 % Define the info fields 'name'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
228 txt1 = uicontrol('String', '', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
229 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
230 'Style', 'Edit', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
231 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
232 'Position', [INFO_X INFO_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
233 INFO_dX INFO_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
234 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
235 % Define the info fields 'size'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
236 txt2 = uicontrol('String', '', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
237 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
238 'Style', 'Edit', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
239 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
240 'Position', [(INFO_X+INFO_dX) INFO_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
241 INFO_dX INFO_dY],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
242 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
243 % Define the info fields 'class'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
244 txt3 = uicontrol('String', '', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
245 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
246 'Style', 'Edit', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
247 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
248 'Position', [(INFO_X+2*INFO_dX) INFO_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
249 INFO_dX INFO_dY],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
250 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
251 % Define the info fields 'value'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
252 txt4 = uicontrol('String', '', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
253 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
254 'Style', 'Edit', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
255 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
256 'Position', [ INFO_X (INFO_Y-INFO_dY) ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
257 3*INFO_dX INFO_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
258 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
259
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
260 % Define the info fields 'value'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
261 txt5 = uicontrol('String', '', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
262 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
263 'Style', 'listbox', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
264 'Visible', 'off', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
265 'Fontsize', 8, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
266 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
267 'Position', [DISP_X DISP_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
268 DISP_dX DISP_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
269 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
270
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
271
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
272
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
273 % Define the decription of the info fields
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
274 col1 = uicontrol('String', 'Name', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
275 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
276 'Style', 'Text', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
277 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
278 'Position', [INFO_X (INFO_Y+INFO_dY)...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
279 INFO_dX INFO_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
280 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
281 col2 = uicontrol('String', 'Size', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
282 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
283 'Style', 'Text', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
284 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
285 'Position', [(INFO_X+INFO_dX) (INFO_Y+INFO_dY)...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
286 INFO_dX INFO_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
287 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
288 col3 = uicontrol('String', 'Class', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
289 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
290 'Style', 'Text', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
291 'FontSize', FONT_SIZE, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
292 'Position', [(INFO_X+2*INFO_dX) (INFO_Y+INFO_dY)...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
293 INFO_dX INFO_dY], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
294 'BackgroundColor', BG_COLOR);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
295
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
296 % Define the name of the explorer
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
297 expl_name = uicontrol('String', 'LTPDA Object explorer', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
298 'Units', 'normalized', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
299 'Style', 'text', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
300 'Position', [EXPL_NAME_X-.05 EXPL_NAME_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
301 EXPL_NAME_dX+.1 EXPL_NAME_dY],...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
302 'ForeGroundColor', [0.2 0.4 1], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
303 'BackGroundColor', BG_COLOR, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
304 'FontSize', 18, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
305 'FontWeight', 'bold', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
306 'FontAngle', 'italic');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
307
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
308 tree_menu = uicontextmenu();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
309 tree_menu1 = uimenu(tree_menu, 'Label', 'Plot', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
310 'Callback', @f_tree_menu1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
311 tree_menu2 = uimenu(tree_menu, 'Label', 'Display', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
312 'Callback', @f_tree_menu2);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
313
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
314 disp_menu = uicontextmenu;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
315 disp_menu1 = uimenu(disp_menu, 'Label', 'close', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
316 'Callback', @f_disp_menu1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
317
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
318 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
319 set(tree.Tree, 'MousePressedCallback', @mouse_cb);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
320 set(tree.Tree, 'UIContextMenu', tree_menu);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
321 set(tree.Tree, 'Font', javax.swing.plaf.FontUIResource('Dialog', 0, FONT_SIZE))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
322 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
323
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
325 % Mouse Pressed Handler
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
326 function mouse_cb(h, ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
327 if ev.getModifiers()== ev.META_MASK
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
328 % Workaround to set the y position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
329 % Workaround to set the x position
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
330 vis = get(get(ev, 'Component'), 'VisibleRect');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
331 x_width = get(get(ev, 'Component'), 'Width');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
332 y_height = get(get(ev, 'Component'), 'Height');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
333
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
334 new_x = ev.getX-vis(1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
335 new_y = -ev.getY+y_height-(y_height-vis(4));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
336 set(tree_menu, 'Position', [new_x new_y], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
337 'Visible', 'on');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
338 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
339
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
340 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
341 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
342 function f_disp_menu1(h, ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
343 set(txt5, 'Visible', 'off')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
344 set(tree, 'position', [TREE_X TREE_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
345 TREE_dX TREE_dY])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
346 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
348 function f_tree_menu1(h,ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
349 plotselected_cb;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
350 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
352 function f_tree_menu2(h,ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
353 displayselected_cb;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
354 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
356 function plotselected_cb(h, ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
357
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
358 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
359 S = get(tmp, 'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
360 s = S{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
361 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
362 [val, plotted, cNode] = getcNodevalue(cNode, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
363
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
364 cla(haxes)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
365 box off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
366 axis off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
367
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
368 %%%%% Plot history object %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
369 if (isa(val,'history'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
370 if length(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
371 figure;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
372 plot(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
373 ii = strfind(plotted, 'inhists');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
374 title(haxes, sprintf('History-Level: %d', length(ii)+1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
375 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
376 na = text(0.5,0.5,'Select the left or right branch.');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
377 set(na, 'HorizontalAlignment', 'center', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
378 'Color', 'r', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
379 'FontWeight', 'bold', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
380 'EdgeColor', 'k', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
381 'BackgroundColor', 'w', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
382 'Fontsize', 10, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
383 'Margin', 5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
384 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
385
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
386 %%%%% Plot data object %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
387 elseif isa(val,'fsdata') || isa(val,'tsdata') || ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
388 isa(val,'xydata') || isa(val,'cdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
389 aoin = getcNodevalue(S{2}.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
390 iplot(aoin)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
391
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
392 %%%%% Plot the AO object %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
393 elseif isa(val, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
394 iplot(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
395
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
396 %%%%% Plot mfir and miir object %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
397 elseif isa(val, 'mfir') || isa(val, 'miir')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
398 resp(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
399
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
400 %%%%% Plot pzmodel object %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
401 elseif isa(val, 'pzmodel')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
402 resp(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
403
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
404 %%%%% Is the parent node == 'data' so plot data %%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
405 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
406
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
407 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
408
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
409 if cNode.getLevel >= 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
410 obj = getcNodevalue(S{2}.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
411
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
412 if isa(obj, 'ltpda_data')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
413 aoin = getcNodevalue(S{2}.getParent.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
414 iplot(aoin);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
415 elseif isa(obj, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
416 iplot(obj);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
417 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
418 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
419
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
420 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
421
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
422 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
424 function displayselected_cb(h, ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
425 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
426 S = get(tmp, 'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
427 s = S{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
428 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
429 [val, displayed, cNode] = getcNodevalue(cNode, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
430
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
431 text1 = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
432 if isobject(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
433 text1 = display(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
434 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
435 disp(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
436 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
437
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
438 % some sisplay outputs contains '\n' <-> char(10)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
439 % text can not display this character so replace it with ' '
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
440 text1 = strrep(text1, char(10), ' ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
441
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
442 set(tree, 'position', [TREE_X TREE_Y ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
443 TREE_dX TREE_dY-DISP_dY]);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
444 set(txt5, 'string', text1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
445 set(txt5, 'Visible', 'on');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
446 set(txt5, 'UIContextMenu', disp_menu);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
447 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
448 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
449
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
450 function cNode = nodeSelected_cb4(tree,ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
451 cNode = ev.getCurrentNode;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
452 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
453 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
454 cell_Data = get(tmp, 'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
455 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
456 cell_Data{2} = cNode;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
457 s = cell_Data{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
458 val = s;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
459 plotted = cNode.getValue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
460 selected = plotted;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
461 [val, plotted, cNode] = getcNodevalue(cNode, val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
462 set(txt1, 'string', selected)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
463 set(txt2, 'string', strcat(num2str(size(val,1)),'x',num2str(size(val,2))) )
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
464 set(txt3, 'string', class(val))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
465
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
466 str = ' ';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
467 c_str = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
468 cla(haxes)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
469 axesSize = get(haxes,'Position');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
470 axesSize = axesSize + [-.07 -.05 .09 0.05];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
471 plotPanel = findobj(gcf,'Tag','plotPanel');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
472 if isempty(plotPanel), plotPanel = uipanel('Position',axesSize,'Tag','plotPanel','BorderType','none','BackgroundColor',[.925 .914 .847]); end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
473 delete(get(plotPanel,'Children'))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
474 box off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
475 axis off;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
476
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
477 if ~isempty(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
478
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
479 if isnumeric(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
480 % normalize the vector
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
481 si = size(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
482 if si(1) > si(2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
483 val = val.';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
484 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
485 val = val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
486 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
487 if size(val,1) == 1 || size(val,2) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
488 if length(val) > 3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
489 str = strcat(num2str(val(1:3)), ' ...');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
490 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
491 str = num2str(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
492 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
493 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
494 str = 'Matrix';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
495 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
496
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
497 elseif ischar(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
498 str = val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
499
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
500 elseif islogical(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
501 if val
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
502 str = 'true';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
503 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
504 str = 'false';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
505 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
506
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
507 elseif isobject(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
508 if isa(val, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
509 str = 'Analysis Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
510 if ~isa(val.data, 'cdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
511 iplot(val,plist('Figure',plotPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
512 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
513 iplot(val,plist('Figure',plotPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
514 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
515 elseif isa(val, 'cdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
516 str = 'C-Data Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
517 aoin = getcNodevalue(ev.getCurrentNode.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
518 elseif isa(val, 'fsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
519 str = 'Frequency-Series Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
520 aoin = getcNodevalue(ev.getCurrentNode.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
521 iplot(aoin,plist('Figure',plotPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
522 elseif isa(val, 'tsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
523 str = 'Time-Series Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
524 aoin = getcNodevalue(ev.getCurrentNode.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
525 iplot(aoin,plist('Figure',plotPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
526 elseif isa(val, 'xydata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
527 str = 'X-Y Data Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
528 aoin = getcNodevalue(ev.getCurrentNode.getParent, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
529 iplot(aoin,plist('Figure',plotPanel));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
530 elseif isa(val, 'xyzdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
531 str = 'X-Y-Z Data Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
532 elseif isa(val, 'history')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
533 str = 'History Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
534 if length(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
535 pl = plist(param('stop_option', MAX_HIST_DEPTH));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
536 plot(haxes, val, pl);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
537 ii = strfind(plotted, 'inhists');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
538 title(haxes, sprintf('History-Level: %d', length(ii)+1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
539 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
540 c_str{1} = 'Select the left or right branch.';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
541 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
542
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
543 elseif isa(val, 'param')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
544 if length(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
545 str = char(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
546 c_str = split_by_comma(str);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
547 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
548 for ii = 1:length(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
549 str = char(val(ii));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
550 c_str1 = split_by_comma(str, '- ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
551 c_str(end+1:end+length(c_str1)) = c_str1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
552 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
553 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
554 str = 'Parameter Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
555
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
556 elseif isa(val, 'plist')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
557 if numel(val) > 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
558 c_str{1} = 'select a plist';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
559 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
560 for ii=1:length(val.params)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
561
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
562 str = char(val.params(ii));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
563 c_str1 = split_by_comma(str, '- ');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
564 c_str(end+1:end+length(c_str1)) = strrep(c_str1, '_', '\_');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
565 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
566 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
567 str = 'Parameter List Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
568
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
569 elseif isa(val, 'mfir')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
570 str = 'FIR Filter Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
571 elseif isa(val, 'miir')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
572 str = 'IIR Filter Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
573 elseif isa(val, 'provenance')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
574 str = 'Provenance Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
575 elseif isa(val, 'pzmodel')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
576 str = 'Pole Zero Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
577 elseif isa(val, 'specwin')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
578 str = 'Spectral Window Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
579 elseif isa(val, 'pz')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
580 str = 'Pole/Zero Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
581 elseif isa(val, 'time')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
582 str = 'Time Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
583 elseif isa(val, 'timespan')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
584 str = 'Time span Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
585 elseif isa(val, 'ssm')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
586 str = 'statespace model Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
587 elseif isa(val, 'unit')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
588 str = 'Unit Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
589 elseif isa(val, 'minfo')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
590 str = 'Method info Object';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
591 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
592 cl = class(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
593 str = sprintf('%s%s Object', upper(cl(1)), lower(cl(2:end)));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
594 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
595
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
596 elseif iscell(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
597 for i = 1:min(length(val),3)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
598 if ischar(val{i})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
599 str = strcat(str, val{i});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
600 elseif isnumeric(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
601 str = strcat(str, num2str(val{i}));
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
602 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
603 if i < min(length(val),3)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
604 str = strcat(str, ',');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
605 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
606 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
607 if length(val) > 3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
608 str = strcat(str,'...');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
609 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
610
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
611 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
612
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
613 if ~isempty(c_str)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
614 c_str = strtrim(c_str);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
615 na = text(0.5,0.5,c_str);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
616 txt_extent = get(na, 'Extent');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
617 set(na, 'Position', [0.5-txt_extent(3)/2, 0.5], ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
618 'HorizontalAlignment', 'left', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
619 'Color', 'k', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
620 'FontWeight', 'bold', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
621 'EdgeColor', 'k', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
622 'BackgroundColor', 'w', ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
623 'Fontsize', 10, ...
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
624 'Margin', 5);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
625 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
626
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
627 else % ~isempty(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
628 str = 'The field is empty';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
629 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
630 set(txt4, 'string', str)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
631 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
632 set(tmp, 'UserData', cell_Data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
633 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
634 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
635
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
636
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
637 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
638 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
639
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
640 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
641
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
644 function nodes = myExpfcn4(tree,value)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
645
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
646 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
647 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
648 S = get(tmp, 'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
649 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
650 s = S{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
651 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
652 [val, cNode] = getcNodevalue(cNode, s);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
653
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
654 % Set the path to the *.gif files
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
655 % This tis the current path of this function + 'exp_struct_icons'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
656 pth = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
657 eval (sprintf('pth = which(''%s'');',mfilename))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
658 index = find(pth==filesep, 1, 'last');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
659 pth = pth(1:index);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
660 pth = [pth 'exp_struct_icons' filesep];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
661
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
662 [n,m] = size(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
663 count = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
664
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
665 %%% Vector or Matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
666 if m>1 || n>1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
667
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
668 if isa(val, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
669 iconpath =[pth,'analysis_object.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
670 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
671 iconpath =[pth,'struct_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
672 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
673
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
674 %%% Vector
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
675 if m==1 || n==1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
676 L = length(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
677
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
678 for J = 1:L
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
679 count = count + 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
680 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
681
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
682 level = cNode.getLevel;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
683 fname = strcat(cNode.getValue, '(', num2str(J),')');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
684
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
685 if level==0 && ~isempty(S{3}) && numel(S{3}) == numel(S{1})
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
686 node_str = S{3}(J);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
687 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
688 node_str = fname;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
689 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
690
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
691 nodes(count) = uitreenode('v0',fname, node_str, iconpath, 0);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
692 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
693 %%% Matrix
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
694 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
695
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
696 for ii=1:n
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
697 for jj=1:m
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
698 count = count + 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
699 cNode = S{2};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
700 fname = [cNode.getValue '(' num2str(ii) ',' num2str(jj) ')'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
701 nodes(count) = uitreenode('v0',fname, fname, iconpath, 0);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
702 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
703 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
704
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
705 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
706 %%% Struct, Object or single value
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
707 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
708 %%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
709 val = val;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
710 if ~isempty(val)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
711 fnames = fieldnames(val);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
712 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
713 fnames = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
714 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
715
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
716 for i=1:length(fnames)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
717 count = count + 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
718 x = getfield(val,fnames{i});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
719
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
720 if isa(x, 'ao')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
721 iconpath =[pth,'analysis_object.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
722 elseif isa(x, 'tsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
723 iconpath =[pth,'ts_data.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
724 elseif isa(x, 'fsdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
725 iconpath =[pth,'fs_data.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
726 elseif isa(x, 'xydata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
727 iconpath =[pth,'xy_data.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
728 elseif isa(x, 'cdata')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
729 iconpath =[pth,'c_data.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
730 elseif isa(x, 'history')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
731 iconpath =[pth,'history.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
732 elseif isa(x, 'plist')
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
733 iconpath =[pth,'plist.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
734
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
735 elseif isstruct(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
736 if length(x) > 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
737 iconpath =[pth,'structarray_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
738 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
739 iconpath =[pth,'struct_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
740 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
741 elseif isnumeric(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
742 iconpath =[pth,'double_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
743 elseif iscell(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
744 iconpath =[pth,'cell_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
745 elseif ischar(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
746 iconpath =[pth,'char_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
747 elseif islogical(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
748 iconpath =[pth,'logic_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
749 elseif isobject(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
750 iconpath =[pth,'obj_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
751 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
752 iconpath =[pth,'unknown_icon.gif'];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
753 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
754
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
755 if isstruct(x) || isobject(x)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
756 isLeaf = 0;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
757 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
758 isLeaf = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
759 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
760
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
761 nodes(count) = uitreenode('v0',fnames{i}, fnames{i}, iconpath, isLeaf);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
762 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
763 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
764
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
765 if (count == 0)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
766 nodes = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
767 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
768 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
769
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
770 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
771
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
772 function cNode = nodeWillExpand_cb4(tree,ev)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
773 cNode = ev.getCurrentNode;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
774 tmp = tree.FigureComponent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
775 warning('off','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
776 cell_Data = get(tmp, 'UserData');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
777 cell_Data{2} = cNode;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
778 set(tmp, 'UserData', cell_Data);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
779 warning('on','MATLAB:hg:JavaSetHGProperty');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
780 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
781
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
782 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
783 function [val, displayed, cNode] = getcNodevalue(cNode, s)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
784
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
785 fields = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
786 while cNode.getLevel ~=0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
787 fields = [fields; cNode.getValue];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
788 c = findstr(cNode.getValue, '(');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
789 if ~isempty(c) && cNode.getLevel ~=0
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
790 cNode = cNode.getParent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
791 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
792
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
793 if cNode.getLevel ==0, break; end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
794 cNode = cNode.getParent;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
795 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
796
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
797 val = s;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
798
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
799 if ~isempty(fields)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
800 L=length(fields);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
801 displayed = fields{L};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
802 % create the variable: displayed
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
803 for j = L-1:-1:1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
804 displayed = strcat(displayed, '.', fields{j});
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
805 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
806
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
807 for i = L:-1:1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
808 field = fields{i};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
809 von = findstr(field,'(');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
810 bis = findstr(field,')');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
811 if ~isempty(von)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
812
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
813 idx = field(von+1:bis-1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
814 field = field(1:von-1);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
815 if (strcmp(field, cNode.getValue))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
816 cmd = sprintf('val = val(%s);',idx);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
817 eval(cmd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
818 if iscell(val) && numel(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
819 val = val{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
820 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
821 error('################ MAch mich neu');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
822 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
823 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
824 cmd = sprintf('val = getfield(val, field, {%s});',idx);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
825 eval(cmd);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
826 if iscell(val) && numel(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
827 val = val{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
828 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
829
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
830 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
831
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
832 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
833 if iscell(val) && numel(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
834 val = val{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
835 elseif numel(val) ~= 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
836 error('################ MAch mich neu');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
837 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
838 val = getfield(val, field);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
839 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
840 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
841 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
842 displayed = cNode.getValue;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
843 if iscell(val) && numel(val) == 1
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
844 val = val{1};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
845 else
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
846 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
847 return;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
848 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
849 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
850
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
851
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
852 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
853 function c_str = split_by_comma(str, pref)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
854
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
855 if nargin < 2
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
856 pref = '';
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
857 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
858
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
859 c_str = {};
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
860 c_str{1} = str;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
861 index = find(str==',');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
862 von = 1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
863 for ii = 1:length(index)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
864 bis = index(ii)-1;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
865 c_str{ii} = [pref str(von:bis)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
866 von = bis + 2;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
867 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
868 if ~isempty(index)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
869 c_str{ii+1} = [pref str(von:end)];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
870 end
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
871
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
872 c_str = strtrim(c_str);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
873 end
|