annotate toolboxes/MIRtoolbox1.3.2/somtoolbox/vis_show_gui_tool.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function r=vis_show_gui_tool(h,action,varargin)
wolffd@0 2
wolffd@0 3 %VIS_SHOW_GUI_TOOL is a subfunction of SOM_SHOW_GUI.
wolffd@0 4 %
wolffd@0 5 % r = vis_show_gui_tool(handle, action, varargin)
wolffd@0 6 %
wolffd@0 7 % Input arguments:
wolffd@0 8 % handle (struct)
wolffd@0 9 % action (string)
wolffd@0 10 % varargin (varies)
wolffd@0 11 %
wolffd@0 12 % See also SOM_SHOW_GUI.
wolffd@0 13
wolffd@0 14 % Copyright (c) 2000 by Roman Feldman and Juha Vesanto
wolffd@0 15 % Contributed to SOM Toolbox on August 22nd, 2000
wolffd@0 16 % http://www.cis.hut.fi/projects/somtoolbox/
wolffd@0 17
wolffd@0 18 % Version 2.0beta roman 160800 juuso 220800
wolffd@0 19
wolffd@0 20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 21
wolffd@0 22 if ishandle(h(1)),
wolffd@0 23 udata = get(h(1),'UserData');
wolffd@0 24 if isfield(udata,'plot_array'),
wolffd@0 25 plot_array = udata.plot_array;
wolffd@0 26 if isfield(udata,'vis_h')
wolffd@0 27 % get most recent plotted
wolffd@0 28 children = get(0,'children');
wolffd@0 29 % first refresh plot info
wolffd@0 30 udata.vis_h = setdiff(udata.vis_h,setdiff(udata.vis_h,children));
wolffd@0 31 set(h(1),'userdata',udata);
wolffd@0 32 for i=1:length(children),
wolffd@0 33 if any(children(i)==udata.vis_h),
wolffd@0 34 child = children(i);
wolffd@0 35 [handles,msg,lattice,msize,dim]=vis_som_show_data('all',children(i));
wolffd@0 36 break;
wolffd@0 37 elseif i==length(children),
wolffd@0 38 errordlg({'Plot not found', ...
wolffd@0 39 'Try to visualize first'},'Error in SOM_VIS: tools');
wolffd@0 40 return;
wolffd@0 41 end
wolffd@0 42 end
wolffd@0 43 else
wolffd@0 44 errordlg({'Plot not found', ...
wolffd@0 45 'Try to visualize first'},'Error in SOM_VIS: tools');
wolffd@0 46 return;
wolffd@0 47 end
wolffd@0 48 end
wolffd@0 49 end
wolffd@0 50
wolffd@0 51 %--- color vars ---
wolffd@0 52 fig_color = [0.8 0.8 0.8];
wolffd@0 53 bg_color1 = [0.701960784313725 0.701960784313725 0.701960784313725];
wolffd@0 54 bg_color2 = [0.9 0.9 0.9];
wolffd@0 55 %--- object position vars (in pixels) ---
wolffd@0 56 % calculations based on case 'comp'
wolffd@0 57 %% hint text
wolffd@0 58 hint_dist1 = 98.17-(61.27+36.9); % hint text lower edge and next lower frame upper edge
wolffd@0 59 hint_dist2 = 123-(98.17+18.45); % figure upper edge and hint text upper edge
wolffd@0 60 %% general
wolffd@0 61 dist1 = 67.42-61.27; % general distance between frame edge and object in frame
wolffd@0 62 %% frame + ok / cancel
wolffd@0 63 frames_dist = 61.27-(8.38+36.9);
wolffd@0 64 frames_dist2 = 8.38;
wolffd@0 65 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 66 ok_pb = [17.1 15.76 75.9 22.14];
wolffd@0 67 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 68 %% objects
wolffd@0 69 hint_txt = [460 18.45]; % hint text width and height
wolffd@0 70 interp_cb = [98.9 24.6];
wolffd@0 71 title_txt = [90 hint_txt(2)-3];
wolffd@0 72 title_edit_h = 23.083;
wolffd@0 73 var_pop = [interp_cb(1) ok_pb(4)];
wolffd@0 74 list_lt = [130 130];
wolffd@0 75 calc_txt = [list_lt(1) hint_txt(2)];
wolffd@0 76 selvar_pb = [110 ok_pb(4)];
wolffd@0 77 strd_ed = [var_pop(1) title_edit_h];
wolffd@0 78 radio_rb = selvar_pb;
wolffd@0 79
wolffd@0 80 %%%%%%%%%%%
wolffd@0 81 % add_label %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 82 %%%%%%%%%%%
wolffd@0 83 if strcmp(action,'add_label')
wolffd@0 84 old_fig_n = watchon;
wolffd@0 85 W = 345.4; H = 222.769;
wolffd@0 86 o21 = zeros(1,4);
wolffd@0 87 o21(1) = (W-f_fr(3))/2;
wolffd@0 88 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 89 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 90 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 91 units = get(h,'units');
wolffd@0 92 set(h,'units','pixels');
wolffd@0 93 fp = get(h,'Position');
wolffd@0 94 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 95 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 96 W ...
wolffd@0 97 H];
wolffd@0 98 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 99 o2 = 4*dist1+2*max([title_edit_h,title_txt(2)]) ...
wolffd@0 100 +max([title_txt(2),var_pop(2)]);
wolffd@0 101 o6 = max([title_txt(2),var_pop(2)]);
wolffd@0 102 o7 = max([title_txt(2),title_edit_h]);
wolffd@0 103 o8 = max([title_txt(2),title_edit_h,selvar_pb(2)]);
wolffd@0 104 o3 = o1+0.5*o6+dist1-title_txt(2)/2;
wolffd@0 105 o4 = o1+0.5*o6+dist1-var_pop(2)/2;
wolffd@0 106 o5 = ok_pb(1)+title_txt(1);
wolffd@0 107 o9 = o1+o6+0.5*o7+2*dist1-title_txt(2)/2;
wolffd@0 108 o10 = o1+o6+0.5*o7+2*dist1-title_edit_h/2;;
wolffd@0 109 o11 = o1+o6+o7+0.5*o8+3*dist1-title_txt(2)/2;
wolffd@0 110 o12 = o1+o6+o7+0.5*o8+3*dist1-title_edit_h/2;
wolffd@0 111 o13 = o1+o6+o7+0.5*o8+3*dist1-selvar_pb(2)/2;
wolffd@0 112 o15 = o1+o2+frames_dist2;
wolffd@0 113 o16 = 2*dist1+o7;
wolffd@0 114 o17 = o5+strd_ed(1)+2*dist1; % W-ok_pb(1)-selvar_pb(1);
wolffd@0 115 o18 = o15+0.5*o7+dist1-title_txt(2)/2;
wolffd@0 116 o19 = o15+0.5*o7+dist1-title_edit_h/2;
wolffd@0 117 o20 = o15+o16+hint_dist1;
wolffd@0 118 hint_text_pos = [1 o20 hint_txt];
wolffd@0 119 frame1_pos = [f_fr(1) o15 f_fr(3) o16];
wolffd@0 120 subplots_text_pos = [ok_pb(1) o18 title_txt];
wolffd@0 121 subplots_pos = [o5 o19 strd_ed];
wolffd@0 122 frame2_pos = [f_fr(1) o1 f_fr(3) o2];
wolffd@0 123 labels_text_pos = [ok_pb(1) o11 title_txt];
wolffd@0 124 labels_pos = [o5 o12 strd_ed];
wolffd@0 125 sel_var_pos = [o17 o13 selvar_pb];
wolffd@0 126 text_size_text_pos = [ok_pb(1) o9 title_txt];
wolffd@0 127 text_size_pos = [o5 o10 strd_ed];
wolffd@0 128 text_color_text_pos = [ok_pb(1) o3 title_txt];
wolffd@0 129 text_color_pos = [o5 o4 var_pop];
wolffd@0 130 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 131 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 132 frame3_pos = f_fr+o21;
wolffd@0 133 ok_pos = ok_pb+o21;
wolffd@0 134 cancel_pos = cancel_pb+o21;
wolffd@0 135
wolffd@0 136 fig_h = figure( ...
wolffd@0 137 'Units','pixels', ...
wolffd@0 138 'Position', fig_pos, ...
wolffd@0 139 'Color',fig_color, ...
wolffd@0 140 'NumberTitle','off', ...
wolffd@0 141 'Name','add label', ...
wolffd@0 142 'MenuBar','none', ...
wolffd@0 143 'Visible','off');
wolffd@0 144
wolffd@0 145 set( ...
wolffd@0 146 uicontrol( ... %% hint
wolffd@0 147 'Units','pixels', ...
wolffd@0 148 'BackgroundColor',fig_color, ...
wolffd@0 149 'HorizontalAlignment','center', ...
wolffd@0 150 'Position',hint_text_pos, ...
wolffd@0 151 'String','Options for adding labels', ...
wolffd@0 152 'Style','text'),'units','normalized');
wolffd@0 153
wolffd@0 154 set( ...
wolffd@0 155 uicontrol( ... %% [frame]
wolffd@0 156 'Units','pixels', ...
wolffd@0 157 'Position',frame1_pos, ...
wolffd@0 158 'Style','frame'),'units','normalized');
wolffd@0 159
wolffd@0 160 set( ...
wolffd@0 161 uicontrol( ... %% To subplot(s)
wolffd@0 162 'Units','pixels', ...
wolffd@0 163 'Position',subplots_text_pos, ...
wolffd@0 164 'HorizontalAlignment','left', ...
wolffd@0 165 'String','To subplot(s)', ...
wolffd@0 166 'Style','text'),'units','normalized');
wolffd@0 167
wolffd@0 168 ed1_h = uicontrol( ... %% [edit]
wolffd@0 169 'Units','pixels', ...
wolffd@0 170 'BackgroundColor',bg_color2, ...
wolffd@0 171 'Position',subplots_pos, ...
wolffd@0 172 'FontSize',12, ...
wolffd@0 173 'Style','edit');
wolffd@0 174 set(ed1_h,'units','normalized');
wolffd@0 175
wolffd@0 176 set( ...
wolffd@0 177 uicontrol( ... %% [frame]
wolffd@0 178 'Units','pixels', ...
wolffd@0 179 'Position',frame2_pos, ...
wolffd@0 180 'Style','frame'),'units','normalized');
wolffd@0 181
wolffd@0 182 set( ...
wolffd@0 183 uicontrol( ... %% Labels
wolffd@0 184 'Units','pixels', ...
wolffd@0 185 'Position',labels_text_pos, ...
wolffd@0 186 'HorizontalAlignment','left', ...
wolffd@0 187 'String','Labels', ...
wolffd@0 188 'Style','text'),'units','normalized');
wolffd@0 189
wolffd@0 190 ed2_h = uicontrol( ... %% [edit]
wolffd@0 191 'Units','pixels', ...
wolffd@0 192 'BackgroundColor',bg_color2, ...
wolffd@0 193 'Position',labels_pos, ...
wolffd@0 194 'FontSize',12, ...
wolffd@0 195 'Style','edit');
wolffd@0 196 set(ed2_h,'units','normalized');
wolffd@0 197
wolffd@0 198 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 199 'vis_show_gui_tool(tmp(2),''select'')'];
wolffd@0 200 set( ...
wolffd@0 201 uicontrol( ... %% Select variable
wolffd@0 202 'Units','pixels', ...
wolffd@0 203 'Position',sel_var_pos, ...
wolffd@0 204 'String','Select variable', ...
wolffd@0 205 'Callback',s),'units','normalized');
wolffd@0 206
wolffd@0 207 set( ...
wolffd@0 208 uicontrol( ... %% Text size
wolffd@0 209 'Units','pixels', ...
wolffd@0 210 'Position',text_size_text_pos, ...
wolffd@0 211 'HorizontalAlignment','left', ...
wolffd@0 212 'String','Text size', ...
wolffd@0 213 'Style','text'),'units','normalized');
wolffd@0 214
wolffd@0 215 ed3_h = uicontrol( ... %% [edit]
wolffd@0 216 'Units','pixels', ...
wolffd@0 217 'BackgroundColor',bg_color2, ...
wolffd@0 218 'Position',text_size_pos, ...
wolffd@0 219 'String','10', ...
wolffd@0 220 'FontSize',12, ...
wolffd@0 221 'Style','edit');
wolffd@0 222 set(ed3_h,'units','normalized');
wolffd@0 223
wolffd@0 224 set( ...
wolffd@0 225 uicontrol( ... %% Text color
wolffd@0 226 'Units','pixels', ...
wolffd@0 227 'Position',text_color_text_pos, ...
wolffd@0 228 'HorizontalAlignment','left', ...
wolffd@0 229 'String','Text color', ...
wolffd@0 230 'Style','text'),'units','normalized');
wolffd@0 231
wolffd@0 232 ud = {'k' 'w' 'y' 'm' 'c' 'r' 'g' 'b' 'xor' 'none'};
wolffd@0 233 s = {'black' 'white' 'yellow' 'magenta' 'cyan' 'red' 'green' ...
wolffd@0 234 'blue' 'xor' 'none'};
wolffd@0 235 p_h = uicontrol( ... %% [popupmenu]
wolffd@0 236 'Units','pixels', ...
wolffd@0 237 'Position',text_color_pos, ...
wolffd@0 238 'UserData',ud, ...
wolffd@0 239 'String',s, ...
wolffd@0 240 'Style','popupmenu');
wolffd@0 241 set(p_h,'units','normalized');
wolffd@0 242
wolffd@0 243 set( ...
wolffd@0 244 uicontrol( ... %% [frame]
wolffd@0 245 'Units','pixels', ...
wolffd@0 246 'Position',frame3_pos, ...
wolffd@0 247 'Style','frame'),'units','normalized');
wolffd@0 248
wolffd@0 249 s = ['vis_show_gui_tool(' mat2str(h) ',''label'',' mat2str(fig_h) ')'];
wolffd@0 250 set( ...
wolffd@0 251 uicontrol( ... %% OK
wolffd@0 252 'Units','pixels', ...
wolffd@0 253 'Position',ok_pos, ...
wolffd@0 254 'String','OK', ...
wolffd@0 255 'Callback',s),'units','normalized');
wolffd@0 256
wolffd@0 257 set( ...
wolffd@0 258 uicontrol( ... %% Cancel
wolffd@0 259 'Units','pixels', ...
wolffd@0 260 'Position',cancel_pos, ...
wolffd@0 261 'String','Cancel', ...
wolffd@0 262 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 263
wolffd@0 264 watchoff(old_fig_n);
wolffd@0 265 ud = [ed1_h ed2_h ed3_h p_h];
wolffd@0 266 set(fig_h,'units','normalized', ...
wolffd@0 267 'Visible','on', ...
wolffd@0 268 'UserData',ud, ...
wolffd@0 269 'handlevisibility','off');
wolffd@0 270
wolffd@0 271 %%%%%%%%%
wolffd@0 272 % add_hit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 273 %%%%%%%%%
wolffd@0 274 elseif strcmp(action,'add_hit')
wolffd@0 275 old_fig_n = watchon;
wolffd@0 276 W = 424.3; H = 337.642;
wolffd@0 277 o37 = zeros(1,4);
wolffd@0 278 o37(1) = (W-f_fr(3))/2;
wolffd@0 279 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 280 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 281 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 282 units = get(h,'units');
wolffd@0 283 set(h,'units','pixels');
wolffd@0 284 fp = get(h,'Position');
wolffd@0 285 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 286 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 287 W ...
wolffd@0 288 H];
wolffd@0 289 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 290 o2 = o1+dist1;
wolffd@0 291 o6 = max([title_txt(2),var_pop(2)]);
wolffd@0 292 o7 = max([title_txt(2),title_edit_h]);
wolffd@0 293 o8 = max([title_txt(2),title_edit_h,var_pop(2)]);
wolffd@0 294 o38 = max([title_txt(2),title_edit_h,selvar_pb(2)]);
wolffd@0 295 o3 = o8+o6+3*dist1;
wolffd@0 296 o4 = o1+0.5*o8+dist1-title_txt(2)/2;
wolffd@0 297 o5 = o1+0.5*o8+dist1-var_pop(2)/2;
wolffd@0 298 o9 = o1+0.5*o8+dist1-title_edit_h/2;
wolffd@0 299 o21 = o1+o8+0.5*o6+2*dist1-title_txt(2)/2;
wolffd@0 300 o22 = o1+o8+0.5*o6+2*dist1-var_pop(2)/2;
wolffd@0 301 o20 = ok_pb(1)+title_txt(1);
wolffd@0 302 o10 = o20+var_pop(1)+2*dist1;
wolffd@0 303 o11 = o10+title_txt(1);
wolffd@0 304 o12 = o2+o8+dist1+0.5*o6-title_txt(2)/2;
wolffd@0 305 o13 = o2+o8+dist1+0.5*o6-var_pop(2)/2;
wolffd@0 306 o14 = o1+o3+frames_dist2;
wolffd@0 307 o15 = 2*o6+o8+4*dist1;
wolffd@0 308 o16 = o14+dist1+0.5*o6-title_txt(2)/2;
wolffd@0 309 o17 = o14+dist1+0.5*o6-var_pop(2)/2;
wolffd@0 310 o18 = o14+o6+2*dist1+0.5*o8-title_txt(2)/2;
wolffd@0 311 o19 = o14+o6+2*dist1+0.5*o8-title_edit_h/2;
wolffd@0 312 o23 = o14+o6+2*dist1+0.5*o8-var_pop(2)/2;
wolffd@0 313 o24 = o14+o6+3*dist1+o8+0.5*o6-title_txt(2)/2;
wolffd@0 314 o25 = o14+o6+3*dist1+o8+0.5*o6-var_pop(2)/2;
wolffd@0 315 o26 = o14+o15+frames_dist2;
wolffd@0 316 o27 = o8+2*dist1;
wolffd@0 317 o28 = o26+dist1+0.5*o38-title_txt(2)/2;
wolffd@0 318 o29 = o26+dist1+0.5*o38-title_edit_h/2;
wolffd@0 319 o30 = o26+dist1+0.5*o38-selvar_pb(2)/2;
wolffd@0 320 o31 = o10; %W-(ok_pb(1)+selvar_pb(1));
wolffd@0 321 o32 = o26+o27+frames_dist2;
wolffd@0 322 o33 = o7+2*dist1;
wolffd@0 323 o34 = o32+dist1+0.5*o7-title_txt(2)/2;
wolffd@0 324 o35 = o32+dist1+0.5*o7-title_edit_h/2;
wolffd@0 325 o36 = o32+o33+hint_dist1;
wolffd@0 326 hint_text_pos = [1 o36 hint_txt];
wolffd@0 327 frame1_pos = [f_fr(1) o32 f_fr(3) o33];
wolffd@0 328 subplots_text_pos = [ok_pb(1) o34 title_txt];
wolffd@0 329 subplots_pos = [o20 o35 strd_ed];
wolffd@0 330 frame2_pos = [f_fr(1) o26 f_fr(3) o27];
wolffd@0 331 trace_vect_text_pos = [ok_pb(1) o28 title_txt];
wolffd@0 332 trace_vect_pos = [o20 o29 strd_ed];
wolffd@0 333 sel_vect_pos = [o31 o30 selvar_pb];
wolffd@0 334 frame3_pos = [f_fr(1) o14 f_fr(3) o15];
wolffd@0 335 marker_text_pos = [ok_pb(1) o24 title_txt];
wolffd@0 336 marker_pos = [o20 o25 var_pop];
wolffd@0 337 marker_size_text_pos = [ok_pb(1) o18 title_txt];
wolffd@0 338 marker_size_pos = [o20 o19 strd_ed];
wolffd@0 339 size_fact_text_pos = [o10 o18 title_txt];
wolffd@0 340 size_fact_pos = [o11 o23 var_pop];
wolffd@0 341 marker_color_text_pos = [ok_pb(1) o16 title_txt];
wolffd@0 342 marker_color_pos = [o20 o17 var_pop];
wolffd@0 343 edge_color_text_pos = [o10 o16 title_txt];
wolffd@0 344 edge_color_pos = [o11 o17 var_pop];
wolffd@0 345 frame4_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 346 text_text_pos = [ok_pb(1) o21 title_txt];
wolffd@0 347 text_pos = [o20 o22 var_pop];
wolffd@0 348 text_color_text_pos = [ok_pb(1) o4 title_txt];
wolffd@0 349 text_color_pos = [o20 o5 var_pop];
wolffd@0 350 text_size_text_pos = [o10 o4 title_txt];
wolffd@0 351 text_size_pos = [o11 o9 strd_ed];
wolffd@0 352 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 353 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 354 frame5_pos = f_fr+o37;
wolffd@0 355 ok_pos = ok_pb+o37;
wolffd@0 356 cancel_pos = cancel_pb+o37;
wolffd@0 357
wolffd@0 358 fig_h = figure( ...
wolffd@0 359 'Units','pixels', ...
wolffd@0 360 'Position', fig_pos, ...
wolffd@0 361 'Color',fig_color, ...
wolffd@0 362 'NumberTitle','off', ...
wolffd@0 363 'Name','add hit histogram', ...
wolffd@0 364 'MenuBar','none', ...
wolffd@0 365 'Visible','off');
wolffd@0 366
wolffd@0 367 set( ...
wolffd@0 368 uicontrol( ... %% hint
wolffd@0 369 'Units','pixels', ...
wolffd@0 370 'BackgroundColor',fig_color, ...
wolffd@0 371 'HorizontalAlignment','center', ...
wolffd@0 372 'Position',hint_text_pos, ...
wolffd@0 373 'String','Options for adding hit histogram', ...
wolffd@0 374 'Style','text'),'units','normalized');
wolffd@0 375
wolffd@0 376 set( ...
wolffd@0 377 uicontrol( ... %% [frame]
wolffd@0 378 'Units','pixels', ...
wolffd@0 379 'Position',frame1_pos, ...
wolffd@0 380 'Style','frame'),'units','normalized');
wolffd@0 381
wolffd@0 382 set( ...
wolffd@0 383 uicontrol( ... %% To subplot(s)
wolffd@0 384 'Units','pixels', ...
wolffd@0 385 'Position',subplots_text_pos, ...
wolffd@0 386 'HorizontalAlignment','left', ...
wolffd@0 387 'String','To subplot(s)', ...
wolffd@0 388 'Style','text'),'units','normalized');
wolffd@0 389
wolffd@0 390 ed1_h = uicontrol( ... %% [edit]
wolffd@0 391 'Units','pixels', ...
wolffd@0 392 'BackgroundColor',bg_color2, ...
wolffd@0 393 'Position',subplots_pos, ...
wolffd@0 394 'FontSize',12, ...
wolffd@0 395 'Style','edit');
wolffd@0 396 set(ed1_h,'units','normalized');
wolffd@0 397
wolffd@0 398 set( ...
wolffd@0 399 uicontrol( ... %% [frame]
wolffd@0 400 'Units','pixels', ...
wolffd@0 401 'Position',frame2_pos, ...
wolffd@0 402 'Style','frame'),'units','normalized');
wolffd@0 403
wolffd@0 404 set( ...
wolffd@0 405 uicontrol( ... %% Trace vector
wolffd@0 406 'Units','pixels', ...
wolffd@0 407 'Position',trace_vect_text_pos, ...
wolffd@0 408 'HorizontalAlignment','left', ...
wolffd@0 409 'String','Hit vector', ...
wolffd@0 410 'Style','text'),'units','normalized');
wolffd@0 411
wolffd@0 412 ed2_h = uicontrol( ... %% [edit]
wolffd@0 413 'Units','pixels', ...
wolffd@0 414 'BackgroundColor',bg_color2, ...
wolffd@0 415 'Position',trace_vect_pos, ...
wolffd@0 416 'FontSize',12, ...
wolffd@0 417 'Style','edit');
wolffd@0 418 set(ed2_h,'units','normalized');
wolffd@0 419
wolffd@0 420 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 421 'vis_show_gui_tool(tmp(2),''select'')'];
wolffd@0 422 set( ...
wolffd@0 423 uicontrol( ... %% Select variable
wolffd@0 424 'Units','pixels', ...
wolffd@0 425 'Position',sel_vect_pos, ...
wolffd@0 426 'String','Select variable', ...
wolffd@0 427 'Callback',s),'units','normalized');
wolffd@0 428
wolffd@0 429 set( ...
wolffd@0 430 uicontrol( ... %% [frame]
wolffd@0 431 'Units','pixels', ...
wolffd@0 432 'Position',frame3_pos, ...
wolffd@0 433 'Style','frame'),'units','normalized');
wolffd@0 434
wolffd@0 435 set( ...
wolffd@0 436 uicontrol( ... %% Marker
wolffd@0 437 'Units','pixels', ...
wolffd@0 438 'Position',marker_text_pos, ...
wolffd@0 439 'HorizontalAlignment','left', ...
wolffd@0 440 'String','Marker', ...
wolffd@0 441 'Style','text'),'units','normalized');
wolffd@0 442
wolffd@0 443 s = {'lattice' 'o' '.' 'x' '+' '*' 's' 'd' 'v' '^' ...
wolffd@0 444 '<' '>' 'p' 'h' 'none' 'cell array'};
wolffd@0 445 p3_h = uicontrol( ... %% [popupmenu]
wolffd@0 446 'Units','pixels', ...
wolffd@0 447 'Position',marker_pos, ...
wolffd@0 448 'String',s, ...
wolffd@0 449 'Style','popupmenu');
wolffd@0 450 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 451 'vis_show_gui_tool([tmp(6),16],''popup_select'')'];
wolffd@0 452 set(p3_h,'units','normalized','Callback',s);
wolffd@0 453
wolffd@0 454 set( ...
wolffd@0 455 uicontrol( ... %% Marker size
wolffd@0 456 'Units','pixels', ...
wolffd@0 457 'HorizontalAlignment','left', ...
wolffd@0 458 'Position',marker_size_text_pos, ...
wolffd@0 459 'String','Marker size', ...
wolffd@0 460 'Style','text'),'units','normalized');
wolffd@0 461
wolffd@0 462 ed4_h = uicontrol( ... %% [edit]
wolffd@0 463 'Units','pixels', ...
wolffd@0 464 'BackgroundColor',bg_color2, ...
wolffd@0 465 'Position',marker_size_pos, ...
wolffd@0 466 'String','12', ...
wolffd@0 467 'FontSize',12, ...
wolffd@0 468 'Style','edit');
wolffd@0 469 set(ed4_h,'units','normalized','Callback',s);
wolffd@0 470
wolffd@0 471 set( ...
wolffd@0 472 uicontrol( ... %% Size factor
wolffd@0 473 'Units','pixels', ...
wolffd@0 474 'HorizontalAlignment','left', ...
wolffd@0 475 'Position',size_fact_text_pos, ...
wolffd@0 476 'String','Size factor', ...
wolffd@0 477 'Style','text'),'units','normalized');
wolffd@0 478
wolffd@0 479 s = {'common' 'separate'};
wolffd@0 480 p4_h = uicontrol( ... %% [popupmenu]
wolffd@0 481 'Units','pixels', ...
wolffd@0 482 'Position',size_fact_pos, ...
wolffd@0 483 'String',s, ...
wolffd@0 484 'Style','popupmenu');
wolffd@0 485 set(p4_h,'units','normalized');
wolffd@0 486
wolffd@0 487
wolffd@0 488 set( ...
wolffd@0 489 uicontrol( ... %% Marker color
wolffd@0 490 'Units','pixels', ...
wolffd@0 491 'HorizontalAlignment','left', ...
wolffd@0 492 'Position',marker_color_text_pos, ...
wolffd@0 493 'String','Marker color', ...
wolffd@0 494 'Style','text'),'units','normalized');
wolffd@0 495
wolffd@0 496 ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'none' ''};
wolffd@0 497 s = {'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 498 'red' 'green' 'blue' 'none' '-matrix-'};
wolffd@0 499 p5_h = uicontrol( ... %% [popupmenu]
wolffd@0 500 'Units','pixels', ...
wolffd@0 501 'Position',marker_color_pos, ...
wolffd@0 502 'UserData',ud, ...
wolffd@0 503 'String',s, ...
wolffd@0 504 'Style','popupmenu');
wolffd@0 505 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 506 'vis_show_gui_tool([tmp(9) 10],''popup_select'')'];
wolffd@0 507 set(p5_h,'units','normalized','Callback',s);
wolffd@0 508
wolffd@0 509 set( ...
wolffd@0 510 uicontrol( ... %% EdgeColor
wolffd@0 511 'Units','pixels', ...
wolffd@0 512 'Position',edge_color_text_pos, ...
wolffd@0 513 'HorizontalAlignment','left', ...
wolffd@0 514 'String','Edge color', ...
wolffd@0 515 'Style','text'),'units','normalized');
wolffd@0 516
wolffd@0 517 ud = {'none' 'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b'};
wolffd@0 518 s = {'none' 'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 519 'red' 'green' 'blue'};
wolffd@0 520 p6_h = uicontrol( ... %% [popupmenu]
wolffd@0 521 'Units','pixels', ...
wolffd@0 522 'Position',edge_color_pos, ...
wolffd@0 523 'UserData',ud, ...
wolffd@0 524 'String',s, ...
wolffd@0 525 'Style','popupmenu');
wolffd@0 526 set(p6_h,'units','normalized');
wolffd@0 527
wolffd@0 528 set( ...
wolffd@0 529 uicontrol( ... %% [frame]
wolffd@0 530 'Units','pixels', ...
wolffd@0 531 'Position',frame4_pos, ...
wolffd@0 532 'Style','frame'),'units','normalized');
wolffd@0 533
wolffd@0 534 set( ...
wolffd@0 535 uicontrol( ... %% Text
wolffd@0 536 'Units','pixels', ...
wolffd@0 537 'Position',text_text_pos, ...
wolffd@0 538 'HorizontalAlignment','left', ...
wolffd@0 539 'String','Text', ...
wolffd@0 540 'Style','text'),'units','normalized');
wolffd@0 541
wolffd@0 542 s = {'off' 'on'};
wolffd@0 543 p2_h = uicontrol( ... %% [popupmenu]
wolffd@0 544 'Units','pixels', ...
wolffd@0 545 'Position',text_pos, ...
wolffd@0 546 'String',s, ...
wolffd@0 547 'Style','popupmenu');
wolffd@0 548 set(p2_h,'units','normalized');
wolffd@0 549
wolffd@0 550 set( ...
wolffd@0 551 uicontrol( ... %% Text
wolffd@0 552 'Units','pixels', ...
wolffd@0 553 'Position',text_text_pos, ...
wolffd@0 554 'HorizontalAlignment','left', ...
wolffd@0 555 'String','Text', ...
wolffd@0 556 'Style','text'),'units','normalized');
wolffd@0 557
wolffd@0 558 s = {'off' 'on'};
wolffd@0 559 p2_h = uicontrol( ... %% [popupmenu]
wolffd@0 560 'Units','pixels', ...
wolffd@0 561 'Position',text_pos, ...
wolffd@0 562 'String',s, ...
wolffd@0 563 'Style','popupmenu');
wolffd@0 564 set(p2_h,'units','normalized');
wolffd@0 565
wolffd@0 566 set( ...
wolffd@0 567 uicontrol( ... %% Text color
wolffd@0 568 'Units','pixels', ...
wolffd@0 569 'Position',text_color_text_pos, ...
wolffd@0 570 'HorizontalAlignment','left', ...
wolffd@0 571 'String','Text color', ...
wolffd@0 572 'Style','text'),'units','normalized');
wolffd@0 573
wolffd@0 574 ud = {'k' 'w' 'y' 'm' 'c' 'r' 'g' 'b' 'xor'};
wolffd@0 575 s = {'black' 'white' 'yellow' 'magenta' 'cyan' ...
wolffd@0 576 'red' 'green' 'blue' 'xor'};
wolffd@0 577 p1_h = uicontrol( ... %% [popupmenu]
wolffd@0 578 'Units','pixels', ...
wolffd@0 579 'Position',text_color_pos, ...
wolffd@0 580 'UserData',ud, ...
wolffd@0 581 'String',s, ...
wolffd@0 582 'Style','popupmenu');
wolffd@0 583 set(p1_h,'units','normalized');
wolffd@0 584
wolffd@0 585 set( ...
wolffd@0 586 uicontrol( ... %% Text size
wolffd@0 587 'Units','pixels', ...
wolffd@0 588 'Position',text_size_text_pos, ...
wolffd@0 589 'HorizontalAlignment','left', ...
wolffd@0 590 'String','Text size', ...
wolffd@0 591 'Style','text'),'units','normalized');
wolffd@0 592
wolffd@0 593 ed3_h = uicontrol( ... %% [edit]
wolffd@0 594 'Units','pixels', ...
wolffd@0 595 'BackgroundColor',bg_color2, ...
wolffd@0 596 'Position',text_size_pos, ...
wolffd@0 597 'String','3', ...
wolffd@0 598 'FontSize',12, ...
wolffd@0 599 'Style','edit');
wolffd@0 600 set(ed3_h,'units','normalized');
wolffd@0 601
wolffd@0 602 set( ...
wolffd@0 603 uicontrol( ... %% [frame]
wolffd@0 604 'Units','pixels', ...
wolffd@0 605 'Position',frame5_pos, ...
wolffd@0 606 'Style','frame'),'units','normalized');
wolffd@0 607
wolffd@0 608 s = ['vis_show_gui_tool(' mat2str(h) ',''hit'',' mat2str(fig_h) ')'];
wolffd@0 609 set( ...
wolffd@0 610 uicontrol( ... %% OK
wolffd@0 611 'Units','pixels', ...
wolffd@0 612 'Position',ok_pos, ...
wolffd@0 613 'String','OK', ...
wolffd@0 614 'Callback',s),'units','normalized');
wolffd@0 615
wolffd@0 616 set( ...
wolffd@0 617 uicontrol( ... %% Cancel
wolffd@0 618 'Units','pixels', ...
wolffd@0 619 'Position',cancel_pos, ...
wolffd@0 620 'String','Cancel', ...
wolffd@0 621 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 622
wolffd@0 623 watchoff(old_fig_n);
wolffd@0 624 tmp_udata = [ed1_h ed2_h p1_h ed3_h p2_h p3_h ed4_h p4_h p5_h p6_h];
wolffd@0 625 set(fig_h,'units','normalized', ...
wolffd@0 626 'Visible','on', ...
wolffd@0 627 'UserData',tmp_udata, ...
wolffd@0 628 'handlevisibility','off');
wolffd@0 629
wolffd@0 630 %%%%%%%%%%
wolffd@0 631 % add_traj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 632 %%%%%%%%%%
wolffd@0 633 elseif strcmp(action,'add_traj')
wolffd@0 634 old_fig_n = watchon;
wolffd@0 635 W = 424.3; H = 337.642;
wolffd@0 636 o34 = zeros(1,4);
wolffd@0 637 o34(1) = (W-f_fr(3))/2;
wolffd@0 638 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 639 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 640 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 641 units = get(h,'units');
wolffd@0 642 set(h,'units','pixels');
wolffd@0 643 fp = get(h,'Position');
wolffd@0 644 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 645 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 646 W ...
wolffd@0 647 H];
wolffd@0 648 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 649 o2 = o1+dist1;
wolffd@0 650 o6 = max([title_txt(2),var_pop(2)]);
wolffd@0 651 o7 = max([title_txt(2),title_edit_h]);
wolffd@0 652 o8 = max([title_txt(2),title_edit_h,var_pop(2)]);
wolffd@0 653 o38 = max([title_txt(2),title_edit_h,selvar_pb(2)]);
wolffd@0 654 o20 = ok_pb(1)+title_txt(1);
wolffd@0 655 o10 = o20+var_pop(1)+2*dist1;
wolffd@0 656 o11 = o10+title_txt(1);
wolffd@0 657 o3 = 2*o6+o8+4*dist1;
wolffd@0 658 o4 = o1+dist1+0.5*o6-title_txt(2)/2;
wolffd@0 659 o5 = o1+dist1+0.5*o6-var_pop(2)/2;
wolffd@0 660 o9 = o1+2*dist1+o6+0.5*o8-title_txt(2)/2;
wolffd@0 661 o12 = o1+2*dist1+o6+0.5*o8-title_edit_h/2;
wolffd@0 662 o13 = o1+2*dist1+o6+0.5*o8-var_pop(2)/2;
wolffd@0 663 o14 = o1+3*dist1+o6+o8+0.5*o6-title_edit_h/2;
wolffd@0 664 o15 = o1+3*dist1+o6+o8+0.5*o6-var_pop(2)/2;
wolffd@0 665 o16 = o1+o3+frames_dist2;
wolffd@0 666 o17 = o8+o6+3*dist1;
wolffd@0 667 o18 = o16+dist1+0.5*o8-title_txt(2)/2;
wolffd@0 668 o19 = o16+dist1+0.5*o8-title_edit_h/2;
wolffd@0 669 o21 = o16+dist1+0.5*o8-var_pop(2)/2;
wolffd@0 670 o22 = o16+2*dist1+o8+0.5*o6-title_txt(2)/2;
wolffd@0 671 o23 = o16+2*dist1+o8+0.5*o6-var_pop(2)/2;
wolffd@0 672 o24 = o16+o17+frames_dist2;
wolffd@0 673 o25 = o38+2*dist1;
wolffd@0 674 o26 = o24+dist1+0.5*o38-title_txt(2)/2;
wolffd@0 675 o27 = o24+dist1+0.5*o38-title_edit_h/2;
wolffd@0 676 o28 = o24+dist1+0.5*o38-selvar_pb(2)/2;
wolffd@0 677 o29 = o24+o25+frames_dist2;
wolffd@0 678 o30 = o7+2*dist1;
wolffd@0 679 o31 = o29+dist1+0.5*o7-title_txt(2)/2;
wolffd@0 680 o32 = o29+dist1+0.5*o7-title_edit_h/2;
wolffd@0 681 o33 = o29+o30+hint_dist1;
wolffd@0 682 hint_text_pos = [1 o33 hint_txt];
wolffd@0 683 frame1_pos = [f_fr(1) o29 f_fr(3) o30];
wolffd@0 684 subplots_text_pos = [ok_pb(1) o31 title_txt];
wolffd@0 685 subplots_pos = [o20 o32 strd_ed];
wolffd@0 686 frame2_pos = [f_fr(1) o24 f_fr(3) o25];
wolffd@0 687 trace_vect_text_pos = [ok_pb(1) o26 title_txt];
wolffd@0 688 trace_vect_pos = [o20 o27 strd_ed];
wolffd@0 689 sel_vect_pos = [o10 o28 selvar_pb];
wolffd@0 690 frame3_pos = [f_fr(1) o16 f_fr(3) o17];
wolffd@0 691 line_color_text_pos = [ok_pb(1) o22 title_txt];
wolffd@0 692 line_color_pos = [o20 o23 var_pop];
wolffd@0 693 line_width_text_pos = [ok_pb(1) o18 title_txt];
wolffd@0 694 line_width_pos = [o20 o19 strd_ed];
wolffd@0 695 width_factor_text_pos = [o10 o18 title_txt];
wolffd@0 696 width_factor_pos = [o11 o19 var_pop];
wolffd@0 697 frame4_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 698 marker_text_pos = [ok_pb(1) o14 title_txt];
wolffd@0 699 marker_pos = [o20 o15 var_pop];
wolffd@0 700 marker_size_text_pos = [ok_pb(1) o9 title_txt];
wolffd@0 701 marker_size_pos = [o20 o12 strd_ed];
wolffd@0 702 size_factor_text_pos = [o10 o9 title_txt];
wolffd@0 703 size_factor_pos = [o11 o13 var_pop];
wolffd@0 704 marker_color_text_pos = [ok_pb(1) o4 title_txt];
wolffd@0 705 marker_color_pos = [o20 o5 var_pop];
wolffd@0 706 edge_color_text_pos = [o10 o4 title_txt];
wolffd@0 707 edge_color_pos = [o11 o5 var_pop];
wolffd@0 708 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 709 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 710 frame5_pos = f_fr+o34;
wolffd@0 711 ok_pos = ok_pb+o34;
wolffd@0 712 cancel_pos = cancel_pb+o34;
wolffd@0 713
wolffd@0 714 fig_h = figure( ...
wolffd@0 715 'Units','pixels', ...
wolffd@0 716 'Position', fig_pos, ...
wolffd@0 717 'Color',fig_color, ...
wolffd@0 718 'NumberTitle','off', ...
wolffd@0 719 'Name','add trajectory', ...
wolffd@0 720 'MenuBar','none', ...
wolffd@0 721 'Visible','off');
wolffd@0 722
wolffd@0 723 set( ...
wolffd@0 724 uicontrol( ... %% hint
wolffd@0 725 'Units','pixels', ...
wolffd@0 726 'BackgroundColor',fig_color, ...
wolffd@0 727 'HorizontalAlignment','center', ...
wolffd@0 728 'Position',hint_text_pos, ...
wolffd@0 729 'String','Options for adding trajectory', ...
wolffd@0 730 'Style','text'),'units','normalized');
wolffd@0 731
wolffd@0 732 set( ...
wolffd@0 733 uicontrol( ... %% [frame]
wolffd@0 734 'Units','pixels', ...
wolffd@0 735 'Position',frame1_pos, ...
wolffd@0 736 'Style','frame'),'units','normalized');
wolffd@0 737
wolffd@0 738 set( ...
wolffd@0 739 uicontrol( ...
wolffd@0 740 'Units','pixels', ... %% To subplot(s)
wolffd@0 741 'Position',subplots_text_pos, ...
wolffd@0 742 'HorizontalAlignment','left', ...
wolffd@0 743 'String','To subplot(s)', ...
wolffd@0 744 'Style','text'),'units','normalized');
wolffd@0 745
wolffd@0 746 ed1_h = uicontrol( ... %% [edit]
wolffd@0 747 'Units','pixels', ...
wolffd@0 748 'BackgroundColor',bg_color2, ...
wolffd@0 749 'Position',subplots_pos, ...
wolffd@0 750 'FontSize',12, ...
wolffd@0 751 'Style','edit');
wolffd@0 752 set(ed1_h,'units','normalized');
wolffd@0 753
wolffd@0 754 set( ...
wolffd@0 755 uicontrol( ... %% [frame]
wolffd@0 756 'Units','pixels', ...
wolffd@0 757 'Position',frame2_pos, ...
wolffd@0 758 'Style','frame'),'units','normalized');
wolffd@0 759
wolffd@0 760 set( ...
wolffd@0 761 uicontrol( ... %% Trace vector
wolffd@0 762 'Units','pixels', ...
wolffd@0 763 'Position',trace_vect_text_pos, ...
wolffd@0 764 'HorizontalAlignment','left', ...
wolffd@0 765 'String','Trajectory', ...
wolffd@0 766 'Style','text'),'units','normalized');
wolffd@0 767
wolffd@0 768 ed2_h = uicontrol( ... %% [edit]
wolffd@0 769 'Units','pixels', ...
wolffd@0 770 'BackgroundColor',bg_color2, ...
wolffd@0 771 'Position',trace_vect_pos, ...
wolffd@0 772 'FontSize',12, ...
wolffd@0 773 'Style','edit');
wolffd@0 774 set(ed2_h,'units','normalized');
wolffd@0 775
wolffd@0 776 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 777 'vis_show_gui_tool(tmp(2),''select'')'];
wolffd@0 778 set( ...
wolffd@0 779 uicontrol( ... %% Select variable
wolffd@0 780 'Units','pixels', ...
wolffd@0 781 'Position',sel_vect_pos, ...
wolffd@0 782 'String','Select variable', ...
wolffd@0 783 'Callback',s),'units','normalized');
wolffd@0 784
wolffd@0 785 set( ...
wolffd@0 786 uicontrol( ... %% [frame]
wolffd@0 787 'Units','pixels', ...
wolffd@0 788 'Position',frame3_pos, ...
wolffd@0 789 'Style','frame'),'units','normalized');
wolffd@0 790
wolffd@0 791 set( ...
wolffd@0 792 uicontrol( ... %% Line color
wolffd@0 793 'Units','pixels', ...
wolffd@0 794 'Position',line_color_text_pos, ...
wolffd@0 795 'HorizontalAlignment','left', ...
wolffd@0 796 'String','Line color', ...
wolffd@0 797 'Style','text'),'units','normalized');
wolffd@0 798
wolffd@0 799 ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'xor'};
wolffd@0 800 s = {'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 801 'red' 'green' 'blue' 'xor'};
wolffd@0 802 p1_h = uicontrol( ... %% [popupmenu]
wolffd@0 803 'Units','pixels', ...
wolffd@0 804 'Position',line_color_pos, ...
wolffd@0 805 'UserData',ud, ...
wolffd@0 806 'String',s, ...
wolffd@0 807 'Style','popupmenu');
wolffd@0 808 set(p1_h,'units','normalized');
wolffd@0 809
wolffd@0 810 set( ...
wolffd@0 811 uicontrol( ... %% Line width
wolffd@0 812 'Units','pixels', ...
wolffd@0 813 'Position',line_width_text_pos, ...
wolffd@0 814 'HorizontalAlignment','left', ...
wolffd@0 815 'String','Line width', ...
wolffd@0 816 'Style','text'),'units','normalized');
wolffd@0 817
wolffd@0 818 ed3_h = uicontrol( ... %% [edit]
wolffd@0 819 'Units','pixels', ...
wolffd@0 820 'BackgroundColor',bg_color2, ...
wolffd@0 821 'Position',line_width_pos, ...
wolffd@0 822 'String','3', ...
wolffd@0 823 'FontSize',12, ...
wolffd@0 824 'Style','edit');
wolffd@0 825 set(ed3_h,'units','normalized');
wolffd@0 826
wolffd@0 827 set( ...
wolffd@0 828 uicontrol( ... %% Factor
wolffd@0 829 'Units','pixels', ...
wolffd@0 830 'Position',width_factor_text_pos, ...
wolffd@0 831 'HorizontalAlignment','left', ...
wolffd@0 832 'String','Factor', ...
wolffd@0 833 'Style','text'),'units','normalized');
wolffd@0 834
wolffd@0 835 s = {'hit' 'equal'};
wolffd@0 836 p2_h = uicontrol( ... %% [popupmenu]
wolffd@0 837 'Units','pixels', ...
wolffd@0 838 'Position',width_factor_pos, ...
wolffd@0 839 'String',s, ...
wolffd@0 840 'Style','popupmenu');
wolffd@0 841 set(p2_h,'units','normalized');
wolffd@0 842
wolffd@0 843 set( ...
wolffd@0 844 uicontrol( ... %% [frame]
wolffd@0 845 'Units','pixels', ...
wolffd@0 846 'Position',frame4_pos, ...
wolffd@0 847 'Style','frame'),'units','normalized');
wolffd@0 848
wolffd@0 849 set( ...
wolffd@0 850 uicontrol( ... %% Marker
wolffd@0 851 'Units','pixels', ...
wolffd@0 852 'Position',marker_text_pos, ...
wolffd@0 853 'HorizontalAlignment','left', ...
wolffd@0 854 'String','Marker', ...
wolffd@0 855 'Style','text'),'units','normalized');
wolffd@0 856
wolffd@0 857 s = {'o' '.' 'x' '+' '*' 's' 'd' 'v' '^' ...
wolffd@0 858 '<' '>' 'p' 'h' 'none'};
wolffd@0 859 p3_h = uicontrol( ... %% [popupmenu]
wolffd@0 860 'Units','pixels', ...
wolffd@0 861 'Position',marker_pos, ...
wolffd@0 862 'String',s, ...
wolffd@0 863 'Style','popupmenu');
wolffd@0 864 set(p3_h,'units','normalized');
wolffd@0 865
wolffd@0 866 set( ...
wolffd@0 867 uicontrol( ... %% Marker size
wolffd@0 868 'Units','pixels', ...
wolffd@0 869 'HorizontalAlignment','left', ...
wolffd@0 870 'Position',marker_size_text_pos, ...
wolffd@0 871 'String','Marker size', ...
wolffd@0 872 'Style','text'),'units','normalized');
wolffd@0 873
wolffd@0 874 ed4_h = uicontrol( ... %% [edit]
wolffd@0 875 'Units','pixels', ...
wolffd@0 876 'BackgroundColor',bg_color2, ...
wolffd@0 877 'Position',marker_size_pos, ...
wolffd@0 878 'String','10', ...
wolffd@0 879 'FontSize',12, ...
wolffd@0 880 'Style','edit');
wolffd@0 881 set(ed4_h,'units','normalized');
wolffd@0 882
wolffd@0 883 set( ...
wolffd@0 884 uicontrol( ... %% Factor
wolffd@0 885 'Units','pixels', ...
wolffd@0 886 'HorizontalAlignment','left', ...
wolffd@0 887 'Position',size_factor_text_pos, ...
wolffd@0 888 'HorizontalAlignment','left', ...
wolffd@0 889 'String','Factor', ...
wolffd@0 890 'Style','text'),'units','normalized');
wolffd@0 891
wolffd@0 892 s = {'hit' 'equal'};
wolffd@0 893 p4_h = uicontrol( ... %% [popupmenu]
wolffd@0 894 'Units','pixels', ...
wolffd@0 895 'Position',size_factor_pos, ...
wolffd@0 896 'String',s, ...
wolffd@0 897 'Style','popupmenu');
wolffd@0 898 set(p4_h,'units','normalized');
wolffd@0 899
wolffd@0 900 set( ...
wolffd@0 901 uicontrol( ... %% Marker color
wolffd@0 902 'Units','pixels', ...
wolffd@0 903 'HorizontalAlignment','left', ...
wolffd@0 904 'Position',marker_color_text_pos, ...
wolffd@0 905 'String','Marker color', ...
wolffd@0 906 'Style','text'),'units','normalized');
wolffd@0 907
wolffd@0 908 ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'none'};
wolffd@0 909 s = {'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 910 'red' 'green' 'blue' 'none'};
wolffd@0 911 p5_h = uicontrol( ... %% [popupmenu]
wolffd@0 912 'Units','pixels', ...
wolffd@0 913 'Position',marker_color_pos, ...
wolffd@0 914 'UserData',ud, ...
wolffd@0 915 'String',s, ...
wolffd@0 916 'Style','popupmenu');
wolffd@0 917 set(p5_h,'units','normalized');
wolffd@0 918
wolffd@0 919 set( ...
wolffd@0 920 uicontrol( ... %% Edge color
wolffd@0 921 'Units','pixels', ...
wolffd@0 922 'Position',edge_color_text_pos, ...
wolffd@0 923 'HorizontalAlignment','left', ...
wolffd@0 924 'String','Edge color', ...
wolffd@0 925 'Style','text'),'units','normalized');
wolffd@0 926
wolffd@0 927 ud = {'none' 'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b'};
wolffd@0 928 s = {'none' 'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 929 'red' 'green' 'blue'};
wolffd@0 930 p6_h = uicontrol( ... %% [popupmenu]
wolffd@0 931 'Units','pixels', ...
wolffd@0 932 'Position',edge_color_pos, ...
wolffd@0 933 'UserData',ud, ...
wolffd@0 934 'String',s, ...
wolffd@0 935 'Style','popupmenu');
wolffd@0 936 set(p6_h,'units','normalized');
wolffd@0 937
wolffd@0 938 set( ...
wolffd@0 939 uicontrol( ... %% [frame]
wolffd@0 940 'Units','pixels', ...
wolffd@0 941 'Position',frame5_pos, ...
wolffd@0 942 'Style','frame'),'units','normalized');
wolffd@0 943
wolffd@0 944 s = ['vis_show_gui_tool(' mat2str(h) ',''traj'',' mat2str(fig_h) ')'];
wolffd@0 945 set( ...
wolffd@0 946 uicontrol( ... %% OK
wolffd@0 947 'Units','pixels', ...
wolffd@0 948 'Position',ok_pos, ...
wolffd@0 949 'String','OK', ...
wolffd@0 950 'Callback',s),'units','normalized');
wolffd@0 951
wolffd@0 952 set( ...
wolffd@0 953 uicontrol( ... %% Cancel
wolffd@0 954 'Units','pixels', ...
wolffd@0 955 'Position',cancel_pos, ...
wolffd@0 956 'String','Cancel', ...
wolffd@0 957 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 958
wolffd@0 959 watchoff(old_fig_n);
wolffd@0 960 tmp_udata = [ed1_h ed2_h p1_h ed3_h p2_h p3_h ed4_h p4_h p5_h p6_h];
wolffd@0 961 set(fig_h,'units','normalized', ...
wolffd@0 962 'Visible','on', ...
wolffd@0 963 'UserData',tmp_udata, ...
wolffd@0 964 'handlevisibility','off');
wolffd@0 965
wolffd@0 966 %%%%%%%%%%%
wolffd@0 967 % add_comet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 968 %%%%%%%%%%%
wolffd@0 969 elseif strcmp(action,'add_comet')
wolffd@0 970 old_fig_n = watchon;
wolffd@0 971 W = 424.3; H = 265.589;
wolffd@0 972 o26 = zeros(1,4);
wolffd@0 973 o26(1) = (W-f_fr(3))/2;
wolffd@0 974 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 975 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 976 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 977 units = get(h,'units');
wolffd@0 978 set(h,'units','pixels');
wolffd@0 979 fp = get(h,'Position');
wolffd@0 980 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 981 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 982 W ...
wolffd@0 983 H];
wolffd@0 984 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 985 o2 = o1+dist1;
wolffd@0 986 o6 = max([title_txt(2),var_pop(2)]);
wolffd@0 987 o7 = max([title_txt(2),title_edit_h]);
wolffd@0 988 o8 = max([title_txt(2),title_edit_h,var_pop(2)]);
wolffd@0 989 o38 = max([title_txt(2),title_edit_h,selvar_pb(2)]);
wolffd@0 990 o20 = ok_pb(1)+title_txt(1);
wolffd@0 991 o10 = o20+var_pop(1)+2*dist1;
wolffd@0 992 o11 = o10+title_txt(1);
wolffd@0 993 o3 = 2*o6+o7+4*dist1;
wolffd@0 994 o4 = o1+dist1+0.5*o6-title_txt(2)/2;
wolffd@0 995 o5 = o1+dist1+0.5*o6-var_pop(2)/2;
wolffd@0 996 o9 = o1+2*dist1+o6+0.5*o7-title_txt(2)/2;
wolffd@0 997 o12 = o1+2*dist1+o6+0.5*o7-title_edit_h/2;
wolffd@0 998 o13 = o1+3*dist1+o7+1.5*o6-title_txt(2)/2;
wolffd@0 999 o14 = o1+3*dist1+o7+1.5*o6-var_pop(2)/2;
wolffd@0 1000 o15 = o1+o3+frames_dist2;
wolffd@0 1001 o16 = o38+2*dist1;
wolffd@0 1002 o17 = o15+dist1+0.5*o38-title_txt(2)/2;
wolffd@0 1003 o18 = o15+dist1+0.5*o38-title_edit_h/2;
wolffd@0 1004 o19 = o15+dist1+0.5*o38-selvar_pb(2)/2;
wolffd@0 1005 o21 = o15+o16+frames_dist2;
wolffd@0 1006 o22 = o7+2*dist1;
wolffd@0 1007 o23 = o21+dist1+0.5*o7-title_txt(2)/2;
wolffd@0 1008 o24 = o21+dist1+0.5*o7-title_edit_h/2;
wolffd@0 1009 o25 = o21+o22+hint_dist1;
wolffd@0 1010 hint_text_pos = [1 o25 hint_txt];
wolffd@0 1011 frame1_pos = [f_fr(1) o21 f_fr(3) o22];
wolffd@0 1012 subplots_text_pos = [ok_pb(1) o23 title_txt];
wolffd@0 1013 subplots_pos = [o20 o24 strd_ed];
wolffd@0 1014 frame2_pos = [f_fr(1) o15 f_fr(3) o16];
wolffd@0 1015 trace_vect_text_pos = [ok_pb(1) o17 title_txt];
wolffd@0 1016 trace_vect_pos = [o20 o18 strd_ed];
wolffd@0 1017 sel_var_pos = [o10 o19 selvar_pb];
wolffd@0 1018 frame3_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 1019 marker_text_pos = [ok_pb(1) o13 title_txt];
wolffd@0 1020 marker_pos = [o20 o14 var_pop];
wolffd@0 1021 marker_size_text_pos = [ok_pb(1) o9 title_txt];
wolffd@0 1022 marker_size_pos = [o20 o12 var_pop];
wolffd@0 1023 marker_color_text_pos = [ok_pb(1) o4 title_txt];
wolffd@0 1024 marker_color_pos = [o20 o5 var_pop];
wolffd@0 1025 edge_color_text_pos = [o10 o4 title_txt];
wolffd@0 1026 edge_color_pos = [o11 o5 var_pop];
wolffd@0 1027 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 1028 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 1029 frame4_pos = f_fr+o26;
wolffd@0 1030 ok_pos = ok_pb+o26;
wolffd@0 1031 cancel_pos = cancel_pb+o26;
wolffd@0 1032
wolffd@0 1033 fig_h = figure( ...
wolffd@0 1034 'Units','pixels', ...
wolffd@0 1035 'Position', fig_pos, ...
wolffd@0 1036 'Color',fig_color, ...
wolffd@0 1037 'NumberTitle','off', ...
wolffd@0 1038 'Name','add comet', ...
wolffd@0 1039 'MenuBar','none', ...
wolffd@0 1040 'Visible','off');
wolffd@0 1041
wolffd@0 1042 set( ...
wolffd@0 1043 uicontrol( ... %% hint
wolffd@0 1044 'Units','pixels', ...
wolffd@0 1045 'BackgroundColor',fig_color, ...
wolffd@0 1046 'HorizontalAlignment','center', ...
wolffd@0 1047 'Position',hint_text_pos, ...
wolffd@0 1048 'String','Options for adding comet', ...
wolffd@0 1049 'Style','text'),'units','normalized');
wolffd@0 1050
wolffd@0 1051 set( ...
wolffd@0 1052 uicontrol( ... %% [frame]
wolffd@0 1053 'Units','pixels', ...
wolffd@0 1054 'Position',frame1_pos, ...
wolffd@0 1055 'Style','frame'),'units','normalized');
wolffd@0 1056
wolffd@0 1057 set( ...
wolffd@0 1058 uicontrol( ... %% To subplot(s)
wolffd@0 1059 'Units','pixels', ...
wolffd@0 1060 'Position',subplots_text_pos, ...
wolffd@0 1061 'HorizontalAlignment','left', ...
wolffd@0 1062 'String','To subplot(s)', ...
wolffd@0 1063 'Style','text'),'units','normalized');
wolffd@0 1064
wolffd@0 1065 ed1_h = uicontrol( ... %% [edit]
wolffd@0 1066 'Units','pixels', ...
wolffd@0 1067 'BackgroundColor',bg_color2, ...
wolffd@0 1068 'Position',subplots_pos, ...
wolffd@0 1069 'FontSize',12, ...
wolffd@0 1070 'Style','edit');
wolffd@0 1071 set(ed1_h,'units','normalized');
wolffd@0 1072
wolffd@0 1073 set( ...
wolffd@0 1074 uicontrol( ... %% [frame]
wolffd@0 1075 'Units','pixels', ...
wolffd@0 1076 'Position',frame2_pos, ...
wolffd@0 1077 'Style','frame'),'units','normalized');
wolffd@0 1078
wolffd@0 1079 set( ...
wolffd@0 1080 uicontrol( ... %% Trace vector
wolffd@0 1081 'Units','pixels', ...
wolffd@0 1082 'Position',trace_vect_text_pos, ...
wolffd@0 1083 'HorizontalAlignment','left', ...
wolffd@0 1084 'String','Trace vector', ...
wolffd@0 1085 'Style','text'),'units','normalized');
wolffd@0 1086
wolffd@0 1087 ed2_h = uicontrol( ... %% [edit]
wolffd@0 1088 'Units','pixels', ...
wolffd@0 1089 'BackgroundColor',bg_color2, ...
wolffd@0 1090 'Position',trace_vect_pos, ...
wolffd@0 1091 'FontSize',12, ...
wolffd@0 1092 'Style','edit');
wolffd@0 1093 set(ed2_h,'units','normalized');
wolffd@0 1094
wolffd@0 1095 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 1096 'vis_show_gui_tool(tmp(2),''select'')'];
wolffd@0 1097 set( ...
wolffd@0 1098 uicontrol( ... %% Select variable
wolffd@0 1099 'Units','pixels', ...
wolffd@0 1100 'Position',sel_var_pos, ...
wolffd@0 1101 'String','Select variable', ...
wolffd@0 1102 'Callback',s),'units','normalized');
wolffd@0 1103
wolffd@0 1104 set( ...
wolffd@0 1105 uicontrol( ... %% [frame]
wolffd@0 1106 'Units','pixels', ...
wolffd@0 1107 'Position',frame3_pos, ...
wolffd@0 1108 'Style','frame'),'units','normalized');
wolffd@0 1109
wolffd@0 1110 set( ...
wolffd@0 1111 uicontrol( ... %% Marker
wolffd@0 1112 'Units','pixels', ...
wolffd@0 1113 'Position',marker_text_pos, ...
wolffd@0 1114 'HorizontalAlignment','left', ...
wolffd@0 1115 'String','Marker', ...
wolffd@0 1116 'Style','text'),'units','normalized');
wolffd@0 1117
wolffd@0 1118 s = {'o' '.' 'x' '+' '*' 's' 'd' 'v' '^' ...
wolffd@0 1119 '<' '>' 'p' 'h' 'lattice' 'none'};
wolffd@0 1120 p1_h = uicontrol( ... %% [popupmenu]
wolffd@0 1121 'Units','pixels', ...
wolffd@0 1122 'Position',marker_pos, ...
wolffd@0 1123 'String',s, ...
wolffd@0 1124 'Style','popupmenu');
wolffd@0 1125 set(p1_h,'units','normalized');
wolffd@0 1126
wolffd@0 1127 set( ...
wolffd@0 1128 uicontrol( ... %% Marker size
wolffd@0 1129 'Units','pixels', ...
wolffd@0 1130 'HorizontalAlignment','left', ...
wolffd@0 1131 'Position',marker_size_text_pos, ...
wolffd@0 1132 'String','Marker size', ...
wolffd@0 1133 'Style','text'),'units','normalized');
wolffd@0 1134
wolffd@0 1135 ed3_h = uicontrol( ... %% [edit]
wolffd@0 1136 'Units','pixels', ...
wolffd@0 1137 'BackgroundColor',bg_color2, ...
wolffd@0 1138 'Position',marker_size_pos, ...
wolffd@0 1139 'String','[20 4]', ...
wolffd@0 1140 'FontSize',12, ...
wolffd@0 1141 'Style','edit');
wolffd@0 1142 set(ed3_h,'units','normalized');
wolffd@0 1143
wolffd@0 1144 set( ...
wolffd@0 1145 uicontrol( ... %% Marker color
wolffd@0 1146 'Units','pixels', ...
wolffd@0 1147 'HorizontalAlignment','left', ...
wolffd@0 1148 'Position',marker_color_text_pos, ...
wolffd@0 1149 'String','Marker color', ...
wolffd@0 1150 'Style','text'),'units','normalized');
wolffd@0 1151
wolffd@0 1152 ud = {'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b' 'none' ''};
wolffd@0 1153 s = {'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 1154 'red' 'green' 'blue' 'none' '-matrix-'};
wolffd@0 1155 p2_h = uicontrol( ... %% [popupmenu]
wolffd@0 1156 'Units','pixels', ...
wolffd@0 1157 'Position',marker_color_pos, ...
wolffd@0 1158 'UserData',ud, ...
wolffd@0 1159 'String',s, ...
wolffd@0 1160 'Style','popupmenu');
wolffd@0 1161 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 1162 'vis_show_gui_tool([tmp(5) 10],''popup_select'')'];
wolffd@0 1163 set(p2_h,'units','normalized','Callback',s);
wolffd@0 1164
wolffd@0 1165 set( ...
wolffd@0 1166 uicontrol( ... %% Edge color
wolffd@0 1167 'Units','pixels', ...
wolffd@0 1168 'Position',edge_color_text_pos, ...
wolffd@0 1169 'HorizontalAlignment','left', ...
wolffd@0 1170 'String','Edge color', ...
wolffd@0 1171 'Style','text'),'units','normalized');
wolffd@0 1172
wolffd@0 1173 ud = {'none' 'w' 'k' 'y' 'm' 'c' 'r' 'g' 'b'};
wolffd@0 1174 s = {'none' 'white' 'black' 'yellow' 'magenta' 'cyan' ...
wolffd@0 1175 'red' 'green' 'blue'};
wolffd@0 1176 p3_h = uicontrol( ... %% [popupmenu]
wolffd@0 1177 'Units','pixels', ...
wolffd@0 1178 'Position',edge_color_pos, ...
wolffd@0 1179 'UserData',ud, ...
wolffd@0 1180 'String',s, ...
wolffd@0 1181 'Style','popupmenu');
wolffd@0 1182 set(p3_h,'units','normalized');
wolffd@0 1183
wolffd@0 1184 set( ...
wolffd@0 1185 uicontrol( ... %% [frame]
wolffd@0 1186 'Units','pixels', ...
wolffd@0 1187 'Position',frame4_pos, ...
wolffd@0 1188 'Style','frame'),'units','normalized');
wolffd@0 1189
wolffd@0 1190 s = ['vis_show_gui_tool(' mat2str(h) ',''comet'',' mat2str(fig_h) ')'];
wolffd@0 1191 set( ...
wolffd@0 1192 uicontrol( ... %% OK
wolffd@0 1193 'Units','pixels', ...
wolffd@0 1194 'Position',ok_pos, ...
wolffd@0 1195 'String','OK', ...
wolffd@0 1196 'Callback',s),'units','normalized');
wolffd@0 1197
wolffd@0 1198 set( ...
wolffd@0 1199 uicontrol( ... %% Cancel
wolffd@0 1200 'Units','pixels', ...
wolffd@0 1201 'Position',cancel_pos, ...
wolffd@0 1202 'String','Cancel', ...
wolffd@0 1203 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 1204
wolffd@0 1205 watchoff(old_fig_n);
wolffd@0 1206 tmp_udata = [ed1_h ed2_h p1_h ed3_h p2_h p3_h];
wolffd@0 1207 set(fig_h,'units','normalized', ...
wolffd@0 1208 'Visible','on', ...
wolffd@0 1209 'UserData',tmp_udata, ...
wolffd@0 1210 'handlevisibility','off');
wolffd@0 1211
wolffd@0 1212 %%%%%%%%%%%%
wolffd@0 1213 % recolorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1214 %%%%%%%%%%%%
wolffd@0 1215 elseif strcmp(action,'recolorbar')
wolffd@0 1216 old_fig_n = watchon;
wolffd@0 1217 W = 345.4; H = 237.299;
wolffd@0 1218 o25 = zeros(1,4);
wolffd@0 1219 o25(1) = (W-f_fr(3))/2;
wolffd@0 1220 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 1221 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 1222 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 1223 units = get(h,'units');
wolffd@0 1224 set(h,'units','pixels');
wolffd@0 1225 fp = get(h,'Position');
wolffd@0 1226 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 1227 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 1228 W ...
wolffd@0 1229 H];
wolffd@0 1230 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 1231 o2 = o1+dist1;
wolffd@0 1232 o6 = max([title_txt(2),var_pop(2)]);
wolffd@0 1233 o7 = max([title_txt(2),title_edit_h]);
wolffd@0 1234 o8 = max([title_txt(2),title_edit_h,selvar_pb(2)]);
wolffd@0 1235 o20 = ok_pb(1)+title_txt(1);
wolffd@0 1236 o10 = o20+var_pop(1)+2*dist1;
wolffd@0 1237 o11 = o10+title_txt(1);
wolffd@0 1238 o3 = o6+2*dist1;
wolffd@0 1239 o4 = o1+dist1+0.5*o6-title_txt(2)/2;
wolffd@0 1240 o5 = o1+dist1+0.5*o6-var_pop(2)/2;
wolffd@0 1241 o9 = o1+o3+frames_dist2;
wolffd@0 1242 o12 = 2*o8+3*dist1;
wolffd@0 1243 o13 = o9+dist1+0.5*o8-title_txt(2)/2;
wolffd@0 1244 o14 = o9+dist1+0.5*o8-title_edit_h/2;
wolffd@0 1245 o15 = o9+dist1+0.5*o8-var_pop(2)/2;
wolffd@0 1246 o16 = o9+2*dist1+1.5*o8-title_txt(2)/2;
wolffd@0 1247 o17 = o9+2*dist1+1.5*o8-title_edit_h/2;
wolffd@0 1248 o18 = o9+2*dist1+1.5*o8-var_pop(2)/2;
wolffd@0 1249 o19 = o9+o12+frames_dist2;
wolffd@0 1250 o21 = o7+2*dist1;
wolffd@0 1251 o22 = o19+dist1+0.5*o7-title_txt(2)/2;
wolffd@0 1252 o23 = o19+dist1+0.5*o7-title_edit_h/2;
wolffd@0 1253 o24 = o19+o21+hint_dist1;
wolffd@0 1254 hint_text_pos = [1 o24 hint_txt];
wolffd@0 1255 frame1_pos = [f_fr(1) o19 f_fr(3) o21];
wolffd@0 1256 subplots_text_pos = [ok_pb(1) o22 title_txt];
wolffd@0 1257 subplots_pos = [o20 o23 strd_ed];
wolffd@0 1258 frame2_pos = [f_fr(1) o9 f_fr(3) o12];
wolffd@0 1259 tics_text_pos = [ok_pb(1) o16 title_txt];
wolffd@0 1260 tics_pos = [o20 o17 strd_ed];
wolffd@0 1261 sel_var2_pos = [o10 o18 var_pop];
wolffd@0 1262 labels_text_pos = [ok_pb(1) o13 title_txt];
wolffd@0 1263 labels_pos = [o20 o14 strd_ed];
wolffd@0 1264 sel_var1_pos = [o10 o15 var_pop];
wolffd@0 1265 frame3_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 1266 scale_text_pos = [ok_pb(1) o4 title_txt];
wolffd@0 1267 scale_pos = [o20 o5 1.3*var_pop(1) var_pop(2)];
wolffd@0 1268 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 1269 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 1270 frame4_pos = f_fr+o25;
wolffd@0 1271 ok_pos = ok_pb+o25;
wolffd@0 1272 cancel_pos = cancel_pb+o25;
wolffd@0 1273
wolffd@0 1274 fig_h = figure( ...
wolffd@0 1275 'Units','pixels', ...
wolffd@0 1276 'Position', fig_pos, ...
wolffd@0 1277 'Color',fig_color, ...
wolffd@0 1278 'NumberTitle','off', ...
wolffd@0 1279 'Name','recolorbar', ...
wolffd@0 1280 'MenuBar','none', ...
wolffd@0 1281 'Visible','off');
wolffd@0 1282
wolffd@0 1283 set( ...
wolffd@0 1284 uicontrol( ... %% hint
wolffd@0 1285 'Units','pixels', ...
wolffd@0 1286 'BackgroundColor',fig_color, ...
wolffd@0 1287 'HorizontalAlignment','center', ...
wolffd@0 1288 'Position',hint_text_pos, ...
wolffd@0 1289 'String','Options, recolorbar', ...
wolffd@0 1290 'Style','text'),'units','normalized');
wolffd@0 1291
wolffd@0 1292 set( ...
wolffd@0 1293 uicontrol( ... %% [frame]
wolffd@0 1294 'Units','pixels', ...
wolffd@0 1295 'Position',frame1_pos, ...
wolffd@0 1296 'Style','frame'),'units','normalized');
wolffd@0 1297
wolffd@0 1298 set( ...
wolffd@0 1299 uicontrol( ... %% In subplot(s)
wolffd@0 1300 'Units','pixels', ...
wolffd@0 1301 'Position',subplots_text_pos, ...
wolffd@0 1302 'HorizontalAlignment','left', ...
wolffd@0 1303 'String','In subplot(s)', ...
wolffd@0 1304 'Style','text'),'units','normalized');
wolffd@0 1305
wolffd@0 1306 ed1_h = uicontrol( ... %% [edit]
wolffd@0 1307 'Units','pixels', ...
wolffd@0 1308 'BackgroundColor',bg_color2, ...
wolffd@0 1309 'Position',subplots_pos, ...
wolffd@0 1310 'FontSize',12, ...
wolffd@0 1311 'Style','edit');
wolffd@0 1312 set(ed1_h,'units','normalized');
wolffd@0 1313
wolffd@0 1314 set( ...
wolffd@0 1315 uicontrol( ... %% [frame]
wolffd@0 1316 'Units','pixels', ...
wolffd@0 1317 'Position',frame2_pos, ...
wolffd@0 1318 'Style','frame'),'units','normalized');
wolffd@0 1319
wolffd@0 1320 set( ...
wolffd@0 1321 uicontrol( ... %% Ticks
wolffd@0 1322 'Units','pixels', ...
wolffd@0 1323 'Position',tics_text_pos, ...
wolffd@0 1324 'HorizontalAlignment','left', ...
wolffd@0 1325 'String','Ticks', ...
wolffd@0 1326 'Style','text'),'units','normalized');
wolffd@0 1327
wolffd@0 1328 ed3_h = uicontrol( ... %% [edit]
wolffd@0 1329 'Units','pixels', ...
wolffd@0 1330 'BackgroundColor',bg_color2, ...
wolffd@0 1331 'Position',tics_pos, ...
wolffd@0 1332 'FontSize',12, ...
wolffd@0 1333 'Style','edit');
wolffd@0 1334 set(ed3_h,'units','normalized');
wolffd@0 1335
wolffd@0 1336 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 1337 'vis_show_gui_tool(tmp(3),''select'')'];
wolffd@0 1338 set( ...
wolffd@0 1339 uicontrol( ... %% Select variable
wolffd@0 1340 'Units','pixels', ...
wolffd@0 1341 'Position',sel_var2_pos, ...
wolffd@0 1342 'String','Select variable', ...
wolffd@0 1343 'Callback',s),'units','normalized');
wolffd@0 1344
wolffd@0 1345 set( ...
wolffd@0 1346 uicontrol( ... %% Labels (cell array)
wolffd@0 1347 'Units','pixels', ...
wolffd@0 1348 'Position',labels_text_pos, ...
wolffd@0 1349 'HorizontalAlignment','left', ...
wolffd@0 1350 'String','Labels', ...
wolffd@0 1351 'Style','text'),'units','normalized');
wolffd@0 1352
wolffd@0 1353 ed2_h = uicontrol( ... %% [edit]
wolffd@0 1354 'Units','pixels', ...
wolffd@0 1355 'BackgroundColor',bg_color2, ...
wolffd@0 1356 'Position',labels_pos, ...
wolffd@0 1357 'FontSize',12, ...
wolffd@0 1358 'Style','edit');
wolffd@0 1359 set(ed2_h,'units','normalized');
wolffd@0 1360
wolffd@0 1361 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 1362 'vis_show_gui_tool(tmp(2),''select'')'];
wolffd@0 1363 set( ...
wolffd@0 1364 uicontrol( ... %% Select variable
wolffd@0 1365 'Units','pixels', ...
wolffd@0 1366 'Position',sel_var1_pos, ...
wolffd@0 1367 'String','Select variable', ...
wolffd@0 1368 'Callback',s),'units','normalized');
wolffd@0 1369
wolffd@0 1370 set( ...
wolffd@0 1371 uicontrol( ... %% [frame]
wolffd@0 1372 'Units','pixels', ...
wolffd@0 1373 'Position',frame3_pos, ...
wolffd@0 1374 'Style','frame'),'units','normalized');
wolffd@0 1375
wolffd@0 1376 set( ...
wolffd@0 1377 uicontrol( ... %% Scale
wolffd@0 1378 'Units','pixels', ...
wolffd@0 1379 'Position',scale_text_pos, ...
wolffd@0 1380 'HorizontalAlignment','left', ...
wolffd@0 1381 'String','Scale', ...
wolffd@0 1382 'Style','text'),'units','normalized');
wolffd@0 1383
wolffd@0 1384 s = {'denormalized' 'normalized'};
wolffd@0 1385 p1_h = uicontrol( ... %% [popupmenu]
wolffd@0 1386 'Units','pixels', ...
wolffd@0 1387 'Position',scale_pos, ...
wolffd@0 1388 'String',s, ...
wolffd@0 1389 'Style','popupmenu');
wolffd@0 1390 set(p1_h,'units','normalized');
wolffd@0 1391
wolffd@0 1392 set( ...
wolffd@0 1393 uicontrol( ... %% [frame]
wolffd@0 1394 'Units','pixels', ...
wolffd@0 1395 'Position',frame4_pos, ...
wolffd@0 1396 'Style','frame'),'units','normalized');
wolffd@0 1397
wolffd@0 1398 s = ['vis_show_gui_tool(' mat2str(h) ',''do_recolorbar'',' mat2str(fig_h) ')'];
wolffd@0 1399 set( ...
wolffd@0 1400 uicontrol( ... %% OK
wolffd@0 1401 'Units','pixels', ...
wolffd@0 1402 'Position',ok_pos, ...
wolffd@0 1403 'String','OK', ...
wolffd@0 1404 'Callback',s),'units','normalized');
wolffd@0 1405
wolffd@0 1406 set( ...
wolffd@0 1407 uicontrol( ... %% Cancel
wolffd@0 1408 'Units','pixels', ...
wolffd@0 1409 'Position',cancel_pos, ...
wolffd@0 1410 'String','Cancel', ...
wolffd@0 1411 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 1412
wolffd@0 1413 watchoff(old_fig_n);
wolffd@0 1414 tmp_udata = [ed1_h ed2_h ed3_h p1_h];
wolffd@0 1415 set(fig_h,'units','normalized', ...
wolffd@0 1416 'Visible','on', ...
wolffd@0 1417 'UserData',tmp_udata, ...
wolffd@0 1418 'handlevisibility','off');
wolffd@0 1419
wolffd@0 1420 %%%%%%%
wolffd@0 1421 % clear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1422 %%%%%%%
wolffd@0 1423 elseif strcmp(action,'clear')
wolffd@0 1424 old_fig_n = watchon;
wolffd@0 1425 W = 232; H = 277.463;
wolffd@0 1426 o25 = zeros(1,4);
wolffd@0 1427 o25(1) = (W-f_fr(3))/2;
wolffd@0 1428 f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame
wolffd@0 1429 cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14];
wolffd@0 1430 hint_txt = [W 18.45]; % hint text width and height
wolffd@0 1431 units = get(h,'units');
wolffd@0 1432 set(h,'units','pixels');
wolffd@0 1433 fp = get(h,'Position');
wolffd@0 1434 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 1435 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 1436 W ...
wolffd@0 1437 H];
wolffd@0 1438 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 1439 o2 = o1+dist1;
wolffd@0 1440 o3 = (W-radio_rb(1))/2;
wolffd@0 1441 o4 = o2+radio_rb(2)+dist1;
wolffd@0 1442 o5 = o4+radio_rb(2)+dist1;
wolffd@0 1443 o6 = o5+radio_rb(2)+dist1;
wolffd@0 1444 o7 = o6+radio_rb(2)+dist1;
wolffd@0 1445 o8 = 5*radio_rb(2)+6*dist1;
wolffd@0 1446 o9 = o1+o8+frames_dist2;
wolffd@0 1447 o10 = max([title_txt(2),title_edit_h]);
wolffd@0 1448 o11 = o9+dist1+0.5*o10-title_txt(2)/2;
wolffd@0 1449 o12 = o9+dist1+0.5*o10-strd_ed(2)/2;
wolffd@0 1450 o20 = W-(ok_pb(1)+strd_ed(1));
wolffd@0 1451 o13 = o10+2*dist1;
wolffd@0 1452 o24 = o9+o13+hint_dist1;
wolffd@0 1453 hint_text_pos = [1 o24 hint_txt];
wolffd@0 1454 frame1_pos = [f_fr(1) o9 f_fr(3) o13];
wolffd@0 1455 subplots_text_pos = [ok_pb(1) o11 title_txt];
wolffd@0 1456 subplots_pos = [o20 o12 strd_ed];
wolffd@0 1457 frame2_pos = [f_fr(1) o1 f_fr(3) o8];
wolffd@0 1458 radiob1_pos = [o3 o7 selvar_pb];
wolffd@0 1459 radiob2_pos = [o3 o6 selvar_pb];
wolffd@0 1460 radiob3_pos = [o3 o5 selvar_pb];
wolffd@0 1461 radiob4_pos = [o3 o4 selvar_pb];
wolffd@0 1462 radiob5_pos = [o3 o2 selvar_pb];
wolffd@0 1463 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 1464 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 1465 frame3_pos = f_fr;%+o25;
wolffd@0 1466 ok_pos = ok_pb;%+o25;
wolffd@0 1467 cancel_pos = cancel_pb;%+o25;
wolffd@0 1468
wolffd@0 1469 fig_h = figure( ...
wolffd@0 1470 'Units','pixels', ...
wolffd@0 1471 'Position', fig_pos, ...
wolffd@0 1472 'Color',fig_color, ...
wolffd@0 1473 'NumberTitle','off', ...
wolffd@0 1474 'Name','clear label', ...
wolffd@0 1475 'MenuBar','none', ...
wolffd@0 1476 'Visible','off');
wolffd@0 1477
wolffd@0 1478 set( ...
wolffd@0 1479 uicontrol( ... %% hint
wolffd@0 1480 'Units','pixels', ...
wolffd@0 1481 'BackgroundColor',fig_color, ...
wolffd@0 1482 'HorizontalAlignment','center', ...
wolffd@0 1483 'Position',hint_text_pos, ...
wolffd@0 1484 'String','Options for clearing', ...
wolffd@0 1485 'Style','text'),'units','normalized');
wolffd@0 1486
wolffd@0 1487 set( ...
wolffd@0 1488 uicontrol( ... %% [frame]
wolffd@0 1489 'Units','pixels', ...
wolffd@0 1490 'Position',frame1_pos, ...
wolffd@0 1491 'Style','frame'),'units','normalized');
wolffd@0 1492
wolffd@0 1493 set( ...
wolffd@0 1494 uicontrol( ... %% From subplots
wolffd@0 1495 'Units','pixels', ...
wolffd@0 1496 'Position',subplots_text_pos, ...
wolffd@0 1497 'String','From subplots', ...
wolffd@0 1498 'Style','text'),'units','normalized');
wolffd@0 1499
wolffd@0 1500 ed1_h = uicontrol( ... %% [edit]
wolffd@0 1501 'Units','pixels', ...
wolffd@0 1502 'BackgroundColor',bg_color2, ...
wolffd@0 1503 'Position',subplots_pos, ...
wolffd@0 1504 'FontSize',12, ...
wolffd@0 1505 'Style','edit');
wolffd@0 1506 set(ed1_h,'units','normalized');
wolffd@0 1507
wolffd@0 1508 set( ...
wolffd@0 1509 uicontrol( ... %% [frame]
wolffd@0 1510 'Units','pixels', ...
wolffd@0 1511 'Position',frame2_pos, ...
wolffd@0 1512 'Style','frame'),'units','normalized');
wolffd@0 1513
wolffd@0 1514 rb1_h = uicontrol( ... %%
wolffd@0 1515 'Units','pixels', ...
wolffd@0 1516 'Position',radiob1_pos, ...
wolffd@0 1517 'style','radiobutton', ...
wolffd@0 1518 'String','All', ...
wolffd@0 1519 'value',1);
wolffd@0 1520
wolffd@0 1521 rb2_h = uicontrol( ... %%
wolffd@0 1522 'Units','pixels', ...
wolffd@0 1523 'Position',radiob2_pos, ...
wolffd@0 1524 'style','radiobutton', ...
wolffd@0 1525 'String','Comet');
wolffd@0 1526
wolffd@0 1527 rb3_h = uicontrol( ... %%
wolffd@0 1528 'Units','pixels', ...
wolffd@0 1529 'Position',radiob3_pos, ...
wolffd@0 1530 'style','radiobutton', ...
wolffd@0 1531 'String','Hit');
wolffd@0 1532
wolffd@0 1533 rb4_h = uicontrol( ... %%
wolffd@0 1534 'Units','pixels', ...
wolffd@0 1535 'Position',radiob4_pos, ...
wolffd@0 1536 'style','radiobutton', ...
wolffd@0 1537 'String','Label');
wolffd@0 1538
wolffd@0 1539 rb5_h = uicontrol( ... %%
wolffd@0 1540 'Units','pixels', ...
wolffd@0 1541 'Position',radiob5_pos, ...
wolffd@0 1542 'style','radiobutton', ...
wolffd@0 1543 'String','Trajectory');
wolffd@0 1544
wolffd@0 1545 set( ...
wolffd@0 1546 uicontrol( ... %% [frame]
wolffd@0 1547 'Units','pixels', ...
wolffd@0 1548 'Position',frame3_pos, ...
wolffd@0 1549 'Style','frame'),'units','normalized');
wolffd@0 1550
wolffd@0 1551 s = ['vis_show_gui_tool(' mat2str(h) ',''c_clear'',' mat2str(fig_h) ')'];
wolffd@0 1552 set( ...
wolffd@0 1553 uicontrol( ... %% OK
wolffd@0 1554 'Units','pixels', ...
wolffd@0 1555 'Position',ok_pos, ...
wolffd@0 1556 'String','OK', ...
wolffd@0 1557 'Callback',s),'units','normalized');
wolffd@0 1558
wolffd@0 1559 set( ...
wolffd@0 1560 uicontrol( ... %% Cancel
wolffd@0 1561 'Units','pixels', ...
wolffd@0 1562 'Position',cancel_pos, ...
wolffd@0 1563 'String','Cancel', ...
wolffd@0 1564 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 1565
wolffd@0 1566 watchoff(old_fig_n);
wolffd@0 1567 tmp_udata = [ed1_h rb1_h rb2_h rb3_h rb4_h rb5_h];
wolffd@0 1568 set(fig_h,'units','normalized', ...
wolffd@0 1569 'Visible','on', ...
wolffd@0 1570 'UserData',tmp_udata, ...
wolffd@0 1571 'handlevisibility','off');
wolffd@0 1572
wolffd@0 1573 %%%%%%%%%
wolffd@0 1574 % c_clear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1575 %%%%%%%%%
wolffd@0 1576 elseif strcmp(action,'c_clear')
wolffd@0 1577 thisfig = varargin{1};
wolffd@0 1578 u = get(varargin{1},'UserData');
wolffd@0 1579 s = get(u(1),'String');
wolffd@0 1580 if ~isempty(s)
wolffd@0 1581 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1582 sprintf(s,'[%s]',s);
wolffd@0 1583 e = eval(s); else e = s;
wolffd@0 1584 end
wolffd@0 1585 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1586 if ischar(e),
wolffd@0 1587 if ~strcmp(e,'all'),
wolffd@0 1588 errordlg({'Only valid string value' ...
wolffd@0 1589 'for subplot indices is ''all''.'}, ...
wolffd@0 1590 'Error in SOM_VIS: tools');
wolffd@0 1591 return;
wolffd@0 1592 else
wolffd@0 1593 e=1:length(handles);
wolffd@0 1594 end
wolffd@0 1595 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1596 errordlg({'Subplot indices must be in', ...
wolffd@0 1597 'range 1...number_of_subplots!'}, ...
wolffd@0 1598 'Error in SOM_VIS: tools');
wolffd@0 1599 return;
wolffd@0 1600 end
wolffd@0 1601 elseif ~isempty(e)
wolffd@0 1602 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1603 return;
wolffd@0 1604 end
wolffd@0 1605 else,
wolffd@0 1606 e = '';
wolffd@0 1607 end
wolffd@0 1608 set(0,'currentfigure',child)
wolffd@0 1609 v = get(u(2),'value');
wolffd@0 1610 if v,
wolffd@0 1611 if ~isempty(e),
wolffd@0 1612 som_show_clear('lab',e);
wolffd@0 1613 som_show_clear('hit',e);
wolffd@0 1614 som_show_clear('traj',e);
wolffd@0 1615 som_show_clear('comet',e);
wolffd@0 1616 else
wolffd@0 1617 som_show_clear('lab');
wolffd@0 1618 som_show_clear('hit');
wolffd@0 1619 som_show_clear('traj');
wolffd@0 1620 som_show_clear('comet');
wolffd@0 1621 end
wolffd@0 1622 end
wolffd@0 1623 v = get(u(3),'value');
wolffd@0 1624 if v,
wolffd@0 1625 if ~isempty(e)
wolffd@0 1626 som_show_clear('comet',e);
wolffd@0 1627 else
wolffd@0 1628 som_show_clear('comet');
wolffd@0 1629 end
wolffd@0 1630 end
wolffd@0 1631 v = get(u(4),'value');
wolffd@0 1632 if v,
wolffd@0 1633 if ~isempty(e),
wolffd@0 1634 som_show_clear('hit',e);
wolffd@0 1635 else
wolffd@0 1636 som_show_clear('hit');
wolffd@0 1637 end
wolffd@0 1638 end
wolffd@0 1639 v = get(u(5),'value');
wolffd@0 1640 if v,
wolffd@0 1641 if ~isempty(e),
wolffd@0 1642 som_show_clear('lab',e);
wolffd@0 1643 else
wolffd@0 1644 som_show_clear('lab');
wolffd@0 1645 end
wolffd@0 1646 end
wolffd@0 1647 v = get(u(6),'value');
wolffd@0 1648 if v,
wolffd@0 1649 if ~isempty(e),
wolffd@0 1650 som_show_clear('traj',e);
wolffd@0 1651 else
wolffd@0 1652 som_show_clear('traj');
wolffd@0 1653 end
wolffd@0 1654 end
wolffd@0 1655 close(thisfig);
wolffd@0 1656
wolffd@0 1657 %%%%%%%%%%%%%%
wolffd@0 1658 % do_recolorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1659 %%%%%%%%%%%%%%
wolffd@0 1660 elseif strcmp(action,'do_recolorbar')
wolffd@0 1661 args = {};
wolffd@0 1662 ud = get(varargin{1},'UserData');
wolffd@0 1663 s = get(ud(1),'String');
wolffd@0 1664 e = 1:length(handles);
wolffd@0 1665 if ~isempty(s)
wolffd@0 1666 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1667 sprintf(s,'[%s]',s);
wolffd@0 1668 e = eval(s); else e = s;
wolffd@0 1669 end
wolffd@0 1670 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1671 if ischar(e) & ~strcmp(e,'all'),
wolffd@0 1672 errordlg({'Only valid string value' ...
wolffd@0 1673 'for subplot indices is ''all''.'}, ...
wolffd@0 1674 'Error in SOM_VIS: tools');
wolffd@0 1675 return;
wolffd@0 1676 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1677 errordlg({'Subplot indices must be in', ...
wolffd@0 1678 'range 1...number_of_subplots.'}, ...
wolffd@0 1679 'Error in SOM_VIS: tools');
wolffd@0 1680 return;
wolffd@0 1681 end
wolffd@0 1682 elseif ~isempty(e)
wolffd@0 1683 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1684 return;
wolffd@0 1685 end
wolffd@0 1686 end
wolffd@0 1687 args = [args {e}];
wolffd@0 1688 s = get(ud(3),'String');
wolffd@0 1689 tmp = 'auto';
wolffd@0 1690 if strcmp(s,'auto') | strcmp(s,'border'),
wolffd@0 1691 tmp = s;
wolffd@0 1692 elseif ~isempty(s)
wolffd@0 1693 tmp = evalin('base',s);
wolffd@0 1694 end
wolffd@0 1695 args = [args {tmp}];
wolffd@0 1696 v = get(ud(4),'Value');
wolffd@0 1697 s = get(ud(4),'String');
wolffd@0 1698 args = [args {s{v}}];
wolffd@0 1699 s = get(ud(2),'String');
wolffd@0 1700 if ~isempty(s)
wolffd@0 1701 args = [args {evalin('base',s)}];
wolffd@0 1702 end
wolffd@0 1703 thisfig = varargin{1};
wolffd@0 1704 % set(0,'CurrentFigure',udata.vis_h);
wolffd@0 1705 set(0,'currentfigure',child)
wolffd@0 1706 som_recolorbar(args{:});
wolffd@0 1707 close(thisfig);
wolffd@0 1708
wolffd@0 1709 %%%%%%%
wolffd@0 1710 % label %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1711 %%%%%%%
wolffd@0 1712 elseif strcmp(action,'label')
wolffd@0 1713 args = {'label'};
wolffd@0 1714 ud = get(varargin{1},'UserData');
wolffd@0 1715 s = get(ud(2),'String');
wolffd@0 1716 if ~isempty(s)
wolffd@0 1717 args = [args {evalin('base',s)}];
wolffd@0 1718 else
wolffd@0 1719 args = [args {udata.sM}];
wolffd@0 1720 end
wolffd@0 1721 s = get(ud(3),'String');
wolffd@0 1722 if ~isempty(s)
wolffd@0 1723 args = [args {'TextSize' eval(s)}];
wolffd@0 1724 end
wolffd@0 1725 v = get(ud(4),'Value');
wolffd@0 1726 if v>1,
wolffd@0 1727 s = get(ud(4),'UserData');
wolffd@0 1728 args = [args {'TextColor' s{v}}];
wolffd@0 1729 end
wolffd@0 1730 s = get(ud(1),'String');
wolffd@0 1731 if ~isempty(s)
wolffd@0 1732 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1733 sprintf(s,'[%s]',s);
wolffd@0 1734 e = eval(s); else e = s;
wolffd@0 1735 end
wolffd@0 1736 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1737 if ischar(e),
wolffd@0 1738 if ~strcmp(e,'all'),
wolffd@0 1739 errordlg({'Only valid string value' ...
wolffd@0 1740 'for subplot indices is ''all''.'}, ...
wolffd@0 1741 'Error in SOM_VIS: tools');
wolffd@0 1742 return;
wolffd@0 1743 else
wolffd@0 1744 e=1:length(handles);
wolffd@0 1745 end
wolffd@0 1746 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1747 errordlg({'Subplot indices must be in', ...
wolffd@0 1748 'range 1...number_of_subplots!'}, ...
wolffd@0 1749 'Error in SOM_VIS: tools');
wolffd@0 1750 return;
wolffd@0 1751 end
wolffd@0 1752 elseif ~isempty(e)
wolffd@0 1753 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1754 return;
wolffd@0 1755 end
wolffd@0 1756 args = [args {'SubPlot' e}];
wolffd@0 1757 end
wolffd@0 1758 thisfig = varargin{1};
wolffd@0 1759 % set(0,'CurrentFigure',udata.vis_h);
wolffd@0 1760 set(0,'currentfigure',child)
wolffd@0 1761 som_show_add(args{:});
wolffd@0 1762 close(thisfig);
wolffd@0 1763
wolffd@0 1764 %%%%%
wolffd@0 1765 % hit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1766 %%%%%
wolffd@0 1767 elseif strcmp(action,'hit')
wolffd@0 1768 args = {'hit'};
wolffd@0 1769 ud = get(varargin{1},'UserData');
wolffd@0 1770 s = get(ud(2),'String');
wolffd@0 1771 e = evalin('base',s);
wolffd@0 1772 [dummy k] = size(e);
wolffd@0 1773 args = [args {e}];
wolffd@0 1774 v = get(ud(10),'Value');
wolffd@0 1775 s = get(ud(10),'UserData');
wolffd@0 1776 args = [args {'EdgeColor' s{v}}];
wolffd@0 1777 %
wolffd@0 1778 s = get(ud(7),'String');
wolffd@0 1779 if ~isempty(s)
wolffd@0 1780 args = [args {'MarkerSize' eval(s)}];
wolffd@0 1781 end
wolffd@0 1782 if k == 1,
wolffd@0 1783 v = get(ud(6),'Value');
wolffd@0 1784 if v<16,
wolffd@0 1785 s = get(ud(6),'String');
wolffd@0 1786 args = [args {'Marker' s{v}}];
wolffd@0 1787 else
wolffd@0 1788 % errordlg();
wolffd@0 1789 return;
wolffd@0 1790 end
wolffd@0 1791 v = get(ud(9),'Value');
wolffd@0 1792 if v<10,
wolffd@0 1793 s = get(ud(9),'UserData');
wolffd@0 1794 args = [args {'MarkerColor' s{v}}];
wolffd@0 1795 else
wolffd@0 1796 % errordlg();
wolffd@0 1797 return;
wolffd@0 1798 end
wolffd@0 1799 %
wolffd@0 1800 v = get(ud(5),'Value');
wolffd@0 1801 s = get(ud(5),'String');
wolffd@0 1802 args = [args {'Text' s{v}}];
wolffd@0 1803 if v>1, % 1='off'
wolffd@0 1804 v = get(ud(3),'Value');
wolffd@0 1805 s = get(ud(3),'UserData');
wolffd@0 1806 args = [args {'TextColor' s{v}}];
wolffd@0 1807 %
wolffd@0 1808 s = get(ud(4),'String');
wolffd@0 1809 args = [args {'TextSize' eval(s)}];
wolffd@0 1810 end
wolffd@0 1811 else
wolffd@0 1812 v = get(ud(8),'Value');
wolffd@0 1813 s = get(ud(8),'String');
wolffd@0 1814 args = [args {'SizeFactor' s{v}}];
wolffd@0 1815 %
wolffd@0 1816 v = get(ud(6),'Value');
wolffd@0 1817 s = get(ud(6),'String');
wolffd@0 1818 args = [args {'Marker' s{v}}];
wolffd@0 1819 %
wolffd@0 1820 v = get(ud(9),'Value');
wolffd@0 1821 s = get(ud(9),'UserData');
wolffd@0 1822 args = [args {'MarkerColor' s{v}}];
wolffd@0 1823 end
wolffd@0 1824
wolffd@0 1825 s = get(ud(1),'String');
wolffd@0 1826 if ~isempty(s)
wolffd@0 1827 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1828 sprintf(s,'[%s]',s);
wolffd@0 1829 e = eval(s); else e = s;
wolffd@0 1830 end
wolffd@0 1831 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1832 if ischar(e),
wolffd@0 1833 if ~strcmp(e,'all'),
wolffd@0 1834 errordlg({'Only valid string value' ...
wolffd@0 1835 'for subplot indices is ''all''.'}, ...
wolffd@0 1836 'Error in SOM_VIS: tools');
wolffd@0 1837 return;
wolffd@0 1838 else
wolffd@0 1839 e=1:length(handles);
wolffd@0 1840 end
wolffd@0 1841 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1842 errordlg({'Subplot indices must be in', ...
wolffd@0 1843 'range 1...number_of_subplots!'}, ...
wolffd@0 1844 'Error in SOM_VIS: tools');
wolffd@0 1845 return;
wolffd@0 1846 end
wolffd@0 1847 elseif ~isempty(e)
wolffd@0 1848 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1849 return;
wolffd@0 1850 end
wolffd@0 1851 args = [args {'SubPlot' e}];
wolffd@0 1852 end
wolffd@0 1853 thisfig = varargin{1};
wolffd@0 1854 % set(0,'CurrentFigure',udata.vis_h);
wolffd@0 1855 set(0,'currentfigure',child)
wolffd@0 1856 som_show_add(args{:});
wolffd@0 1857 close(thisfig);
wolffd@0 1858
wolffd@0 1859 %%%%%%
wolffd@0 1860 % traj %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1861 %%%%%%
wolffd@0 1862 elseif strcmp(action,'traj')
wolffd@0 1863 args = {'traj'};
wolffd@0 1864 ud = get(varargin{1},'UserData');
wolffd@0 1865 s = get(ud(2),'String');
wolffd@0 1866 args = [args {evalin('base',s)}];
wolffd@0 1867 s = get(ud(4),'String');
wolffd@0 1868 if ~isempty(s)
wolffd@0 1869 args = [args {'TrajWidth' eval(s)}];
wolffd@0 1870 end
wolffd@0 1871 v = get(ud(5),'Value');
wolffd@0 1872 if v>1,
wolffd@0 1873 s = get(ud(5),'String');
wolffd@0 1874 args = [args {'WidthFactor' s{v}}];
wolffd@0 1875 end
wolffd@0 1876 v = get(ud(3),'Value');
wolffd@0 1877 if v>1,
wolffd@0 1878 s = get(ud(3),'UserData');
wolffd@0 1879 args = [args {'TrajColor' s{v}}];
wolffd@0 1880 end
wolffd@0 1881 v = get(ud(6),'Value');
wolffd@0 1882 if v>1,
wolffd@0 1883 s = get(ud(6),'String');
wolffd@0 1884 args = [args {'Marker' s{v}}];
wolffd@0 1885 end
wolffd@0 1886 s = get(ud(7),'String');
wolffd@0 1887 if ~isempty(s)
wolffd@0 1888 args = [args {'MarkerSize' eval(s)}];
wolffd@0 1889 end
wolffd@0 1890 v = get(ud(8),'Value');
wolffd@0 1891 if v>1,
wolffd@0 1892 s = get(ud(8),'String');
wolffd@0 1893 args = [args {'SizeFactor' s{v}}];
wolffd@0 1894 end
wolffd@0 1895 v = get(ud(9),'Value');
wolffd@0 1896 if v>1,
wolffd@0 1897 s = get(ud(9),'UserData');
wolffd@0 1898 args = [args {'MarkerColor' s{v}}];
wolffd@0 1899 end
wolffd@0 1900 v = get(ud(10),'Value');
wolffd@0 1901 if v>1,
wolffd@0 1902 s = get(ud(10),'UserData');
wolffd@0 1903 args = [args {'EdgeColor' s{v}}];
wolffd@0 1904 end
wolffd@0 1905 s = get(ud(1),'String');
wolffd@0 1906 if ~isempty(s)
wolffd@0 1907 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1908 sprintf(s,'[%s]',s);
wolffd@0 1909 e = eval(s); else e = s;
wolffd@0 1910 end
wolffd@0 1911 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1912 if ischar(e),
wolffd@0 1913 if ~strcmp(e,'all'),
wolffd@0 1914 errordlg({'Only valid string value' ...
wolffd@0 1915 'for subplot indices is ''all''.'}, ...
wolffd@0 1916 'Error in SOM_VIS: tools');
wolffd@0 1917 return;
wolffd@0 1918 else
wolffd@0 1919 e=1:length(handles);
wolffd@0 1920 end
wolffd@0 1921 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1922 errordlg({'Subplot indices must be in', ...
wolffd@0 1923 'range 1...number_of_subplots!'}, ...
wolffd@0 1924 'Error in SOM_VIS: tools');
wolffd@0 1925 return;
wolffd@0 1926 end
wolffd@0 1927 elseif ~isempty(e)
wolffd@0 1928 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1929 return;
wolffd@0 1930 end
wolffd@0 1931 args = [args {'SubPlot' e}];
wolffd@0 1932 end
wolffd@0 1933 thisfig = varargin{1};
wolffd@0 1934 % set(0,'CurrentFigure',udata.vis_h);
wolffd@0 1935 set(0,'currentfigure',child)
wolffd@0 1936 som_show_add(args{:});
wolffd@0 1937 close(thisfig);
wolffd@0 1938
wolffd@0 1939 %%%%%%%
wolffd@0 1940 % comet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 1941 %%%%%%%
wolffd@0 1942 elseif strcmp(action,'comet')
wolffd@0 1943 args = {'comet'};
wolffd@0 1944 ud = get(varargin{1},'UserData');
wolffd@0 1945 s = get(ud(2),'String');
wolffd@0 1946 args = [args {evalin('base',s)}];
wolffd@0 1947 v = get(ud(3),'Value');
wolffd@0 1948 if v>1,
wolffd@0 1949 s = get(ud(3),'String');
wolffd@0 1950 args = [args {'Marker' s{v}}];
wolffd@0 1951 end
wolffd@0 1952 s = get(ud(4),'String');
wolffd@0 1953 if ~isempty(s)
wolffd@0 1954 args = [args {'MarkerSize' eval(s)}];
wolffd@0 1955 end
wolffd@0 1956 v = get(ud(5),'Value');
wolffd@0 1957 s = get(ud(5),'UserData');
wolffd@0 1958 if v==10,
wolffd@0 1959 args = [args {'MarkerColor' evalin('base',s{10})}];
wolffd@0 1960 else
wolffd@0 1961 args = [args {'MarkerColor' s{v}}];
wolffd@0 1962 end
wolffd@0 1963 v = get(ud(6),'Value');
wolffd@0 1964 if v>1,
wolffd@0 1965 s = get(ud(6),'UserData');
wolffd@0 1966 args = [args {'EdgeColor' s{v}}];
wolffd@0 1967 end
wolffd@0 1968 s = get(ud(1),'String');
wolffd@0 1969 if ~isempty(s)
wolffd@0 1970 if s(1)=='[' | (s(1)>='1' & s(1)<='9')
wolffd@0 1971 sprintf(s,'[%s]',s);
wolffd@0 1972 e = eval(s); else e = s;
wolffd@0 1973 end
wolffd@0 1974 if vis_valuetype(e,{'1xn','nx1','string'}),
wolffd@0 1975 if ischar(e),
wolffd@0 1976 if ~strcmp(e,'all'),
wolffd@0 1977 errordlg({'Only valid string value' ...
wolffd@0 1978 'for subplot indices is ''all''.'}, ...
wolffd@0 1979 'Error in SOM_VIS: tools');
wolffd@0 1980 return;
wolffd@0 1981 else
wolffd@0 1982 e=1:length(handles);
wolffd@0 1983 end
wolffd@0 1984 elseif any(e<1) | any(e>length(handles)),
wolffd@0 1985 errordlg({'Subplot indices must be in', ...
wolffd@0 1986 'range 1...number_of_subplots!'}, ...
wolffd@0 1987 'Error in SOM_VIS: tools');
wolffd@0 1988 return;
wolffd@0 1989 end
wolffd@0 1990 elseif ~isempty(e)
wolffd@0 1991 errordlg('Invalid subplot indices!','Error in SOM_VIS: tools');
wolffd@0 1992 return;
wolffd@0 1993 end
wolffd@0 1994 args = [args {'SubPlot' e}];
wolffd@0 1995 end
wolffd@0 1996 thisfig = varargin{1};
wolffd@0 1997 % set(0,'CurrentFigure',udata.vis_h);
wolffd@0 1998 set(0,'currentfigure',child)
wolffd@0 1999 som_show_add(args{:});
wolffd@0 2000 close(thisfig);
wolffd@0 2001
wolffd@0 2002 %%%%%%%%
wolffd@0 2003 % select %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 2004 %%%%%%%%
wolffd@0 2005 elseif strcmp(action,'select')
wolffd@0 2006 %% NOTE: input h is not main_gui_handle
wolffd@0 2007 %% but edit menu handle
wolffd@0 2008 w = evalin('base','whos');
wolffd@0 2009 for (i=1:length(w))
wolffd@0 2010 size_frst{i} = mat2str(w(i).size(1));
wolffd@0 2011 x(i,1) = 'x';
wolffd@0 2012 size_scnd{i} = mat2str(w(i).size(2));
wolffd@0 2013 end
wolffd@0 2014 names = strvcat(w.name);
wolffd@0 2015 [dummy vert] = size(names);
wolffd@0 2016 for (i=1:length(w))
wolffd@0 2017 for (j=1:8)
wolffd@0 2018 sp(i,j) = ' ';
wolffd@0 2019 end
wolffd@0 2020 end
wolffd@0 2021 size_M = strjust(strvcat(size_frst{:}),'right');
wolffd@0 2022 size_N = strjust(strvcat(size_scnd{:}),'left');
wolffd@0 2023 classes = strvcat(w.class);
wolffd@0 2024 s = [cellstr([names sp size_M x size_N sp classes])]';
wolffd@0 2025
wolffd@0 2026 [sel,ok] = listdlg('ListString',s,...
wolffd@0 2027 'Name','Variable selection',...
wolffd@0 2028 'PromptString','Select variable', ...
wolffd@0 2029 'SelectionMode','single');
wolffd@0 2030 if ok & ~isempty(sel),
wolffd@0 2031 w = {w.name};
wolffd@0 2032 if ishandle(h),
wolffd@0 2033 set(h,'String',w{sel});
wolffd@0 2034 elseif nargout==1,
wolffd@0 2035 r = w{sel};
wolffd@0 2036 end
wolffd@0 2037 elseif nargout==1,
wolffd@0 2038 r = '';
wolffd@0 2039 end
wolffd@0 2040
wolffd@0 2041 %%%%%%%%%%%%%%
wolffd@0 2042 % popup_select %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 2043 %%%%%%%%%%%%%%
wolffd@0 2044 elseif strcmp(action,'popup_select')
wolffd@0 2045 %% NOTE: input h is not main_gui_handle
wolffd@0 2046 %% but h(1) is popupmenu handle and h(2:end) are indeces
wolffd@0 2047 v = get(h(1),'Value');
wolffd@0 2048 if any(v==h(2:end)),
wolffd@0 2049 w = evalin('base','whos');
wolffd@0 2050 for (i=1:length(w))
wolffd@0 2051 size_frst{i} = mat2str(w(i).size(1));
wolffd@0 2052 x(i,1) = 'x';
wolffd@0 2053 size_scnd{i} = mat2str(w(i).size(2));
wolffd@0 2054 end
wolffd@0 2055 names = strvcat(w.name);
wolffd@0 2056 [dummy vert] = size(names);
wolffd@0 2057 for (i=1:length(w))
wolffd@0 2058 for (j=1:8)
wolffd@0 2059 sp(i,j) = ' ';
wolffd@0 2060 end
wolffd@0 2061 end
wolffd@0 2062 size_M = strjust(strvcat(size_frst{:}),'right');
wolffd@0 2063 size_N = strjust(strvcat(size_scnd{:}),'left');
wolffd@0 2064 classes = strvcat(w.class);
wolffd@0 2065 s = [cellstr([names sp size_M x size_N sp classes])]';
wolffd@0 2066 [sel,ok] = listdlg('ListString',s,...
wolffd@0 2067 'Name','Variable selection',...
wolffd@0 2068 'PromptString','Select variable', ...
wolffd@0 2069 'SelectionMode','single');
wolffd@0 2070 if ok & ~isempty(sel),
wolffd@0 2071 w = {w.name};
wolffd@0 2072 i = find(v==h(2:end));
wolffd@0 2073 s = get(h(1),'String');
wolffd@0 2074 s{h(i+1)} = w{sel};
wolffd@0 2075 set(h(1),'String',s);
wolffd@0 2076 if nargout==1,
wolffd@0 2077 r = w{sel};
wolffd@0 2078 end
wolffd@0 2079 elseif nargout==1,
wolffd@0 2080 r = '';
wolffd@0 2081 end
wolffd@0 2082 end
wolffd@0 2083
wolffd@0 2084 end
wolffd@0 2085