annotate toolboxes/MIRtoolbox1.3.2/somtoolbox/vis_show_gui_comp.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 vis_show_gui_comp(h, indx, action,varargin)
wolffd@0 2
wolffd@0 3 %VIS_SHOW_GUI_COMP is a subfunction of SOM_SHOW_GUI.
wolffd@0 4 %
wolffd@0 5 % vis_show_gui_comp(handle, indx, action, varargin)
wolffd@0 6 %
wolffd@0 7 % Input arguments:
wolffd@0 8 % handle (struct)
wolffd@0 9 % indx (scalar)
wolffd@0 10 % action (string)
wolffd@0 11 % varargin (varies)
wolffd@0 12 %
wolffd@0 13 % See also SOM_SHOW_GUI.
wolffd@0 14
wolffd@0 15 % Copyright (c) 2000 by Roman Feldman and Juha Vesanto
wolffd@0 16 % Contributed to SOM Toolbox on August 22nd, 2000
wolffd@0 17 % http://www.cis.hut.fi/projects/somtoolbox/
wolffd@0 18
wolffd@0 19 % Version 2.0beta roman 160800 juuso 220800
wolffd@0 20
wolffd@0 21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 22 % MAIN %
wolffd@0 23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 24
wolffd@0 25 udata = get(h,'UserData');
wolffd@0 26 plot_array = udata.plot_array;
wolffd@0 27 l = length(plot_array);
wolffd@0 28
wolffd@0 29 %%%%%%
wolffd@0 30 % init %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 31 %%%%%%
wolffd@0 32
wolffd@0 33 if (strcmp(action,'init'))
wolffd@0 34
wolffd@0 35 %--- color vars ---
wolffd@0 36 fig_color = [0.8 0.8 0.8];
wolffd@0 37 bg_color1 = [0.701960784313725 0.701960784313725 0.701960784313725];
wolffd@0 38 bg_color2 = [0.9 0.9 0.9];
wolffd@0 39 %--- object position vars (in pixels) ---
wolffd@0 40 % calculations based on case 'comp'
wolffd@0 41 %% hint text
wolffd@0 42 hint_dist1 = 98.17-(61.27+36.9); % hint text lower edge and next lower frame upper edge
wolffd@0 43 hint_dist2 = 123-(98.17+18.45); % figure upper edge and hint text upper edge
wolffd@0 44 %% general
wolffd@0 45 dist1 = 67.42-61.27; % general distance between frame edge and object in frame
wolffd@0 46 %% frame + ok / cancel
wolffd@0 47 frames_dist = 61.27-(8.38+36.9);
wolffd@0 48 frames_dist2 = 8.38;
wolffd@0 49 f_fr = [7.9 8.38 216.2 36.9]; % final frame
wolffd@0 50 ok_pb = [17.1 15.76 75.9 22.14];
wolffd@0 51 cancel_pb = [139 15.76 75.9 22.14];
wolffd@0 52 %% objects
wolffd@0 53 hint_txt = [230 18.45]; % hint text width and height
wolffd@0 54 interp_cb = [98.9 24.6];
wolffd@0 55 title_txt = [35 hint_txt(2)];
wolffd@0 56 title_edit_h = 23.083;
wolffd@0 57 var_pop = interp_cb;
wolffd@0 58 list_lt = [130 130];
wolffd@0 59 calc_txt = [list_lt(1) hint_txt(2)];
wolffd@0 60 useall_pb = [50 interp_cb(2)];
wolffd@0 61
wolffd@0 62 if (length(indx) > 1)
wolffd@0 63 errordlg({'Same options for multiple subplots', ...
wolffd@0 64 'not yet available'},'Error in SOM_VIS: options');
wolffd@0 65 return;
wolffd@0 66
wolffd@0 67 elseif (isempty(plot_array(1).args))
wolffd@0 68 errordlg({'Try to select subplot first'}, ...
wolffd@0 69 'Error in SOM_VIS: options');
wolffd@0 70 return;
wolffd@0 71
wolffd@0 72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 73 % 'comp'
wolffd@0 74 %
wolffd@0 75 elseif (strncmp('comp',plot_array(indx).args{1},4))
wolffd@0 76 old_fig_n = watchon;
wolffd@0 77 W = 230; H = 123;
wolffd@0 78 units = get(h,'units');
wolffd@0 79 set(h,'units','pixels');
wolffd@0 80 fp = get(h,'Position');
wolffd@0 81 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 82 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 83 W ...
wolffd@0 84 H];
wolffd@0 85 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 86 o2 = o1+dist1;
wolffd@0 87 o3 = 2*dist1+interp_cb(2);
wolffd@0 88 o4 = o1+o3+hint_dist1;
wolffd@0 89 hint_text_pos = [1 o4 hint_txt];
wolffd@0 90 frame1_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 91 interp_pos = [ok_pb(1) o2 interp_cb];
wolffd@0 92 frame2_pos = f_fr;
wolffd@0 93 ok_pos = ok_pb;
wolffd@0 94 cancel_pos = cancel_pb;
wolffd@0 95
wolffd@0 96 fig_h = figure( ...
wolffd@0 97 'Units','pixels', ...
wolffd@0 98 'Position', fig_pos, ...
wolffd@0 99 'Color',fig_color, ...
wolffd@0 100 'NumberTitle','off', ...
wolffd@0 101 'Name','component', ...
wolffd@0 102 'MenuBar','none', ...
wolffd@0 103 'Visible','off');
wolffd@0 104
wolffd@0 105 set( ...
wolffd@0 106 uicontrol( ... %% hint
wolffd@0 107 'Units','pixels', ...
wolffd@0 108 'BackgroundColor',fig_color, ...
wolffd@0 109 'HorizontalAlignment','center', ...
wolffd@0 110 'Position',hint_text_pos, ...
wolffd@0 111 'String','Options for component plane', ...
wolffd@0 112 'Style','text'),'units','normalized');
wolffd@0 113
wolffd@0 114 set( ...
wolffd@0 115 uicontrol( ... %% [frame]
wolffd@0 116 'Units','pixels', ...
wolffd@0 117 'Position',frame1_pos, ...
wolffd@0 118 'Style','frame'),'units','normalized');
wolffd@0 119
wolffd@0 120 pr = udata.property{indx};
wolffd@0 121 chkb_h = uicontrol( ... %% interpolated
wolffd@0 122 'Units','pixels', ...
wolffd@0 123 'HorizontalAlignment','center', ...
wolffd@0 124 'Position',interp_pos, ...
wolffd@0 125 'Style','checkbox', ...
wolffd@0 126 'String','interpolated', ...
wolffd@0 127 'Value',pr{1});
wolffd@0 128 set(chkb_h,'units','normalized');
wolffd@0 129
wolffd@0 130 set( ...
wolffd@0 131 uicontrol( ... %% [frame]
wolffd@0 132 'Units','pixels', ...
wolffd@0 133 'Position',frame2_pos, ...
wolffd@0 134 'Style','frame'),'units','normalized');
wolffd@0 135
wolffd@0 136 s = ['vis_show_gui_comp(', ...
wolffd@0 137 mat2str(h), ',', mat2str(indx), ...
wolffd@0 138 ',''comp'',' mat2str(fig_h) ')'];
wolffd@0 139 set( ...
wolffd@0 140 uicontrol( ... %% OK
wolffd@0 141 'Units','pixels', ...
wolffd@0 142 'Position',ok_pos, ...
wolffd@0 143 'String','OK', ...
wolffd@0 144 'Callback',s),'units','normalized');
wolffd@0 145
wolffd@0 146 set( ...
wolffd@0 147 uicontrol( ... %% Cancel
wolffd@0 148 'Units','pixels', ...
wolffd@0 149 'Position',cancel_pos, ...
wolffd@0 150 'String','Cancel', ...
wolffd@0 151 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 152
wolffd@0 153 watchoff(old_fig_n);
wolffd@0 154 tmp_udata = [chkb_h];
wolffd@0 155 set(fig_h,'units','normalized', ...
wolffd@0 156 'Visible','on', ...
wolffd@0 157 'UserData',tmp_udata, ...
wolffd@0 158 'handlevisibility','off');
wolffd@0 159
wolffd@0 160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 161 % 'umat'
wolffd@0 162 %
wolffd@0 163 elseif (strncmp('umat',plot_array(indx).args{1},4))
wolffd@0 164 old_fig_n = watchon;
wolffd@0 165 W = 230; H = 335.893;
wolffd@0 166 units = get(h,'units');
wolffd@0 167 set(h,'units','pixels');
wolffd@0 168 fp = get(h,'Position');
wolffd@0 169 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 170 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 171 W ...
wolffd@0 172 H];
wolffd@0 173 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 174 o2 = o1+dist1;
wolffd@0 175 o3 = 2*dist1+list_lt(2)+calc_txt(2);
wolffd@0 176 o4 = o2+list_lt(2);
wolffd@0 177 o5 = sum(cancel_pb([1 3]))-useall_pb(1);
wolffd@0 178 o6 = o2+o3/2-useall_pb(2)/2;
wolffd@0 179 o7 = o1+o3+frames_dist2;
wolffd@0 180 o8 = 2*dist1+interp_cb(2);
wolffd@0 181 o9 = o7+dist1;
wolffd@0 182 o10 = o7+o8+frames_dist2;;
wolffd@0 183 o11 = 2*dist1+max(title_edit_h,title_txt(2));
wolffd@0 184 o12 = W-(title_txt(1)+2*ok_pb(1));
wolffd@0 185 o13 = o10+dist1+(title_edit_h-title_txt(2))/2;
wolffd@0 186 o14 = o10+dist1;
wolffd@0 187 if title_txt(2)>title_edit_h,
wolffd@0 188 o13 = o10+dist1;
wolffd@0 189 o14 = o13+(title_edit_h-title_txt(2))/2;
wolffd@0 190 end
wolffd@0 191 o15 = ok_pb(1)+title_txt(1);
wolffd@0 192 o16 = o10+o11+hint_dist1;
wolffd@0 193 hint_text_pos = [1 o16 hint_txt];
wolffd@0 194 frame1_pos = [f_fr(1) o10 f_fr(3) o11];
wolffd@0 195 title_text_pos = [ok_pb(1) o13 title_txt];
wolffd@0 196 title_pos = [o15 o14 o12 title_edit_h];
wolffd@0 197 frame2_pos = [f_fr(1) o7 f_fr(3) o8];
wolffd@0 198 interp_pos = [ok_pb(1) o9 interp_cb];
wolffd@0 199 frame3_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 200 list_text_pos = [ok_pb(1) o4 calc_txt];
wolffd@0 201 list_pos = [ok_pb(1) o2 list_lt];
wolffd@0 202 use_all_pos = [o5 o6 useall_pb];
wolffd@0 203 frame4_pos = f_fr;
wolffd@0 204 ok_pos = ok_pb;
wolffd@0 205 cancel_pos = cancel_pb;
wolffd@0 206
wolffd@0 207 fig_h = figure( ...
wolffd@0 208 'Units','pixels', ...
wolffd@0 209 'Position', fig_pos, ...
wolffd@0 210 'Color',fig_color, ...
wolffd@0 211 'NumberTitle','off', ...
wolffd@0 212 'Name','U-matrix', ...
wolffd@0 213 'MenuBar','none', ...
wolffd@0 214 'Visible','off');
wolffd@0 215
wolffd@0 216 set( ...
wolffd@0 217 uicontrol( ... %% hint
wolffd@0 218 'Units','pixels', ...
wolffd@0 219 'BackgroundColor',fig_color, ...
wolffd@0 220 'HorizontalAlignment','center', ...
wolffd@0 221 'Position',hint_text_pos, ...
wolffd@0 222 'String','Options for U-matrix', ...
wolffd@0 223 'Style','text'),'units','normalized');
wolffd@0 224
wolffd@0 225 set( ...
wolffd@0 226 uicontrol( ... %% [frame]
wolffd@0 227 'Units','pixels', ...
wolffd@0 228 'Position',frame1_pos, ...
wolffd@0 229 'Style','frame'),'units','normalized');
wolffd@0 230
wolffd@0 231 set( ...
wolffd@0 232 uicontrol( ... %% title
wolffd@0 233 'Units','pixels', ...
wolffd@0 234 'Position',title_text_pos, ...
wolffd@0 235 'BackgroundColor',bg_color1, ...
wolffd@0 236 'HorizontalAlignment','left', ...
wolffd@0 237 'Style','text', ...
wolffd@0 238 'String','Title'),'units','normalized');
wolffd@0 239
wolffd@0 240 pr = udata.property{indx};
wolffd@0 241 ed_h = uicontrol( ... %% [edit]
wolffd@0 242 'Units','pixels', ...
wolffd@0 243 'Position',title_pos, ...
wolffd@0 244 'FontSize',12, ...
wolffd@0 245 'Style','edit', ...
wolffd@0 246 'String',pr{2}, ...
wolffd@0 247 'BackgroundColor',bg_color2);
wolffd@0 248 set(ed_h,'units','normalized');
wolffd@0 249
wolffd@0 250 set( ...
wolffd@0 251 uicontrol( ... %% [frame]
wolffd@0 252 'Units','pixels', ...
wolffd@0 253 'Position',frame2_pos, ...
wolffd@0 254 'Style','frame'),'units','normalized');
wolffd@0 255
wolffd@0 256 chkb_h = uicontrol( ... %% interpolated
wolffd@0 257 'Units','pixels', ...
wolffd@0 258 'Position',interp_pos, ...
wolffd@0 259 'Style','checkbox', ...
wolffd@0 260 'String','interpolated', ...
wolffd@0 261 'Value',pr{1});
wolffd@0 262 set(chkb_h,'units','normalized');
wolffd@0 263
wolffd@0 264 set( ...
wolffd@0 265 uicontrol( ... %% [frame]
wolffd@0 266 'Units','pixels', ...
wolffd@0 267 'Position',frame3_pos, ...
wolffd@0 268 'Style','frame'),'units','normalized');
wolffd@0 269
wolffd@0 270 set( ...
wolffd@0 271 uicontrol( ... %% calculated from
wolffd@0 272 'Units','pixels', ...
wolffd@0 273 'BackgroundColor',bg_color1, ...
wolffd@0 274 'HorizontalAlignment','left', ...
wolffd@0 275 'Position',list_text_pos, ...
wolffd@0 276 'String','calculated from', ...
wolffd@0 277 'Style','text'),'units','normalized');
wolffd@0 278
wolffd@0 279 list1_h = uicontrol( ... %% [listbox]
wolffd@0 280 'Units','pixels', ...
wolffd@0 281 'BackgroundColor',bg_color2, ...
wolffd@0 282 'Position',list_pos, ...
wolffd@0 283 'String',udata.sM.comp_names, ...
wolffd@0 284 'Style','listbox', ...
wolffd@0 285 'Max',2, ...
wolffd@0 286 'Value',pr{3});
wolffd@0 287 set(list1_h,'units','normalized');
wolffd@0 288
wolffd@0 289 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');set(tmp(3),''value'',' ...
wolffd@0 290 mat2str(1:length(udata.sM.comp_names)) ');'];
wolffd@0 291 set( ...
wolffd@0 292 uicontrol( ... %% Use all
wolffd@0 293 'Units','pixels', ...
wolffd@0 294 'Position',use_all_pos, ...
wolffd@0 295 'String','Use all', ...
wolffd@0 296 'Callback',s),'units','normalized');
wolffd@0 297
wolffd@0 298 set( ...
wolffd@0 299 uicontrol( ... %% [frame]
wolffd@0 300 'Units','pixels', ...
wolffd@0 301 'Position',frame4_pos, ...
wolffd@0 302 'Style','frame'),'units','normalized');
wolffd@0 303
wolffd@0 304 s = ['vis_show_gui_comp(' ...
wolffd@0 305 mat2str(h) ',' mat2str(indx) ...
wolffd@0 306 ',''umat'',' mat2str(fig_h) ')'];
wolffd@0 307 set( ...
wolffd@0 308 uicontrol( ... %% OK
wolffd@0 309 'Units','pixels', ...
wolffd@0 310 'Position',ok_pos, ...
wolffd@0 311 'String','OK', ...
wolffd@0 312 'Callback',s),'units','normalized');
wolffd@0 313
wolffd@0 314 set( ...
wolffd@0 315 uicontrol( ... %% Cancel
wolffd@0 316 'Units','pixels', ...
wolffd@0 317 'Position',cancel_pos, ...
wolffd@0 318 'String','Cancel', ...
wolffd@0 319 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 320
wolffd@0 321 watchoff(old_fig_n);
wolffd@0 322 tmp_udata = [chkb_h ed_h list1_h];
wolffd@0 323 set(fig_h,'units','normalized', ...
wolffd@0 324 'Visible','on', ...
wolffd@0 325 'UserData', tmp_udata, ...
wolffd@0 326 'handlevisibility','off');
wolffd@0 327
wolffd@0 328 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 329 % 'color'
wolffd@0 330 %
wolffd@0 331 elseif (strncmp('color',plot_array(indx).args{1},5))
wolffd@0 332 old_fig_n = watchon;
wolffd@0 333 W = 230; H = 212.043;
wolffd@0 334 units = get(h,'units');
wolffd@0 335 set(h,'units','pixels');
wolffd@0 336 fp = get(h,'Position');
wolffd@0 337 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 338 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 339 W ...
wolffd@0 340 H];
wolffd@0 341 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 342 o2 = o1+dist1;
wolffd@0 343 o3 = 2*dist1+var_pop(2);
wolffd@0 344 o4 = o1+o3+frames_dist2;
wolffd@0 345 o5 = o4+dist1;
wolffd@0 346 o6 = 2*dist1+interp_cb(2);
wolffd@0 347 o7 = o4+o6+frames_dist2;
wolffd@0 348 o8 = 2*dist1+max(title_edit_h,title_txt(2));
wolffd@0 349 o9 = W-(title_txt(1)+2*ok_pb(1));
wolffd@0 350 o10 = o7+dist1+(title_edit_h-title_txt(2))/2;
wolffd@0 351 o11 = o7+dist1;
wolffd@0 352 if title_txt(2)>title_edit_h,
wolffd@0 353 o10 = o7+dist1;
wolffd@0 354 o11 = o10+(title_edit_h-title_txt(2))/2;
wolffd@0 355 end
wolffd@0 356 o12 = ok_pb(1)+title_txt(1);
wolffd@0 357 o13 = o7+o8+hint_dist1;
wolffd@0 358 hint_text_pos = [1 o13 hint_txt];
wolffd@0 359 frame1_pos = [f_fr(1) o7 f_fr(3) o8];
wolffd@0 360 title_text_pos = [ok_pb(1) o10 title_txt];
wolffd@0 361 title_pos = [o12 o11 o9 title_edit_h];
wolffd@0 362 frame2_pos = [f_fr(1) o4 f_fr(3) o6];
wolffd@0 363 interp_pos = [ok_pb(1) o5 interp_cb];
wolffd@0 364 frame3_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 365 popup_pos = [ok_pb(1) o2 var_pop];
wolffd@0 366 frame4_pos = f_fr;
wolffd@0 367 ok_pos = ok_pb;
wolffd@0 368 cancel_pos = cancel_pb;
wolffd@0 369
wolffd@0 370 fig_h = figure( ...
wolffd@0 371 'Units','pixels', ...
wolffd@0 372 'Position',fig_pos, ...
wolffd@0 373 'Color',fig_color, ...
wolffd@0 374 'NumberTitle','off', ...
wolffd@0 375 'Name','color plane', ...
wolffd@0 376 'MenuBar','none', ...
wolffd@0 377 'Visible','off');
wolffd@0 378
wolffd@0 379 set( ...
wolffd@0 380 uicontrol( ... %% hint
wolffd@0 381 'Units','pixels', ...
wolffd@0 382 'BackgroundColor',fig_color, ...
wolffd@0 383 'HorizontalAlignment','center', ...
wolffd@0 384 'Position',hint_text_pos, ...
wolffd@0 385 'String','Options for colorplane', ...
wolffd@0 386 'Style','text'),'units','normalized');
wolffd@0 387
wolffd@0 388 set( ...
wolffd@0 389 uicontrol( ... %% [frame]
wolffd@0 390 'Units','pixels', ...
wolffd@0 391 'Position',frame1_pos, ...
wolffd@0 392 'Style','frame'),'units','normalized');
wolffd@0 393
wolffd@0 394 set( ...
wolffd@0 395 uicontrol( ... %% title
wolffd@0 396 'Units','pixels', ...
wolffd@0 397 'Position',title_text_pos, ...
wolffd@0 398 'HorizontalAlignment','left', ...
wolffd@0 399 'Style','text', ...
wolffd@0 400 'String','Title'),'units','normalized');
wolffd@0 401
wolffd@0 402 pr = udata.property{indx};
wolffd@0 403 ed_h = uicontrol( ... %% [edit]
wolffd@0 404 'Units','pixels', ...
wolffd@0 405 'Position',title_pos, ...
wolffd@0 406 'FontSize',12, ...
wolffd@0 407 'Style','edit', ...
wolffd@0 408 'String',pr{2}, ...
wolffd@0 409 'BackgroundColor',bg_color2);
wolffd@0 410 set(ed_h,'units','normalized');
wolffd@0 411
wolffd@0 412 set( ...
wolffd@0 413 uicontrol( ... %% [frame]
wolffd@0 414 'Units','pixels', ...
wolffd@0 415 'Position',frame2_pos, ...
wolffd@0 416 'Style','frame'),'units','normalized');
wolffd@0 417
wolffd@0 418 chkb_h = uicontrol( ... %% interpolated
wolffd@0 419 'Units','pixels', ...
wolffd@0 420 'Position',interp_pos, ...
wolffd@0 421 'Style','checkbox', ...
wolffd@0 422 'String','interpolated', ...
wolffd@0 423 'Value',pr{1});
wolffd@0 424 set(chkb_h,'units','normalized');
wolffd@0 425
wolffd@0 426 set( ...
wolffd@0 427 uicontrol( ... %% [frame]
wolffd@0 428 'Units','pixels', ...
wolffd@0 429 'Position',frame3_pos, ...
wolffd@0 430 'Style','frame'),'units','normalized');
wolffd@0 431
wolffd@0 432 popup1_h = uicontrol( ... %% [popup]
wolffd@0 433 'Units','pixels', ...
wolffd@0 434 'Max',2, ...
wolffd@0 435 'Min',1, ...
wolffd@0 436 'Position',popup_pos, ...
wolffd@0 437 'String',pr{3}, ...
wolffd@0 438 'Style','popupmenu', ...
wolffd@0 439 'Value',pr{4});
wolffd@0 440 s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ...
wolffd@0 441 'vis_show_gui_tool([tmp(3) 6],''popup_select'');' ...
wolffd@0 442 'u=get(' mat2str(h) ',''UserData'');' ...
wolffd@0 443 'v=' mat2str(indx) ';' ...
wolffd@0 444 'pr=u.property{v};' ...
wolffd@0 445 'pr{3}=get(tmp(3),''string'');' ...
wolffd@0 446 'pr{4}=get(tmp(3),''value'');' ...
wolffd@0 447 'u.property{v}=pr;' ...
wolffd@0 448 'set(' mat2str(h) ',''userdata'',u)'];
wolffd@0 449 set(popup1_h,'units','normalized', ...
wolffd@0 450 'Callback',s);
wolffd@0 451
wolffd@0 452 set( ...
wolffd@0 453 uicontrol( ... %% [frame]
wolffd@0 454 'Units','pixels', ...
wolffd@0 455 'Position',frame4_pos, ...
wolffd@0 456 'Style','frame'),'units','normalized');
wolffd@0 457
wolffd@0 458 s = ['vis_show_gui_comp(', ...
wolffd@0 459 mat2str(h), ',', mat2str(indx), ...
wolffd@0 460 ',''color'',' mat2str(fig_h) ')'];
wolffd@0 461 set( ...
wolffd@0 462 uicontrol( ... %% OK
wolffd@0 463 'Units','pixels', ...
wolffd@0 464 'Position',ok_pos, ...
wolffd@0 465 'String','OK', ...
wolffd@0 466 'Callback',s),'units','normalized');
wolffd@0 467
wolffd@0 468 set( ...
wolffd@0 469 uicontrol( ... %% Cancel
wolffd@0 470 'Units','pixels', ...
wolffd@0 471 'Position',cancel_pos, ...
wolffd@0 472 'String','Cancel', ...
wolffd@0 473 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 474
wolffd@0 475 watchoff(old_fig_n);
wolffd@0 476 tmp_udata = [chkb_h ed_h popup1_h];
wolffd@0 477 set(fig_h,'units','normalized', ...
wolffd@0 478 'Visible','on', ...
wolffd@0 479 'UserData', tmp_udata, ...
wolffd@0 480 'handlevisibility','off');
wolffd@0 481
wolffd@0 482 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 483 % 'empty'
wolffd@0 484 %
wolffd@0 485 elseif (strncmp('empty',plot_array(indx).args{1},5))
wolffd@0 486 old_fig_n = watchon;
wolffd@0 487 W = 230; H = 121.483;
wolffd@0 488 units = get(h,'units');
wolffd@0 489 set(h,'units','pixels');
wolffd@0 490 fp = get(h,'Position');
wolffd@0 491 fig_pos = [(fp(1)+fp(3)) ...
wolffd@0 492 (fp(2)+fp(2)+fp(4)/2-H/2) ...
wolffd@0 493 W ...
wolffd@0 494 H];
wolffd@0 495 o1 = sum(f_fr([2 4]))+frames_dist;
wolffd@0 496 o2 = 2*dist1+max(title_edit_h,title_txt(2));
wolffd@0 497 o3 = 2*dist1+interp_cb(2);
wolffd@0 498 o4 = W-(title_txt(1)+2*ok_pb(1));
wolffd@0 499 o5 = o1+dist1+(title_edit_h-title_txt(2))/2;
wolffd@0 500 o6 = o1+dist1;
wolffd@0 501 if title_txt(2)>title_edit_h,
wolffd@0 502 o5 = o1+dist1;
wolffd@0 503 o6 = o5+(title_edit_h-title_txt(2))/2;
wolffd@0 504 end
wolffd@0 505 o7 = ok_pb(1)+title_txt(1);
wolffd@0 506 o8 = o1+o2+hint_dist1;
wolffd@0 507 hint_text_pos = [1 o8 hint_txt];
wolffd@0 508 frame1_pos = [f_fr(1) o1 f_fr(3) o3];
wolffd@0 509 title_text_pos = [ok_pb(1) o5 title_txt];
wolffd@0 510 title_pos = [o7 o6 o4 title_edit_h];
wolffd@0 511 frame2_pos = f_fr;
wolffd@0 512 ok_pos = ok_pb;
wolffd@0 513 cancel_pos = cancel_pb;
wolffd@0 514
wolffd@0 515 fig_h = figure( ...
wolffd@0 516 'Units','pixels', ...
wolffd@0 517 'Position', fig_pos, ...
wolffd@0 518 'Color',fig_color, ...
wolffd@0 519 'NumberTitle','off', ...
wolffd@0 520 'Name','empty plane', ...
wolffd@0 521 'MenuBar','none', ...
wolffd@0 522 'Visible','off');
wolffd@0 523
wolffd@0 524 set( ...
wolffd@0 525 uicontrol( ... %% hint
wolffd@0 526 'Units','pixels', ...
wolffd@0 527 'BackgroundColor',fig_color, ...
wolffd@0 528 'HorizontalAlignment','center', ...
wolffd@0 529 'Position',hint_text_pos, ...
wolffd@0 530 'String','Options for empty plane', ...
wolffd@0 531 'Style','text'),'units','normalized');
wolffd@0 532
wolffd@0 533 set( ...
wolffd@0 534 uicontrol( ... %% [frame]
wolffd@0 535 'Units','pixels', ...
wolffd@0 536 'Position',frame1_pos, ...
wolffd@0 537 'Style','frame'),'units','normalized');
wolffd@0 538
wolffd@0 539 set( ...
wolffd@0 540 uicontrol( ... %% title
wolffd@0 541 'Units','pixels', ...
wolffd@0 542 'Position',title_text_pos, ...
wolffd@0 543 'HorizontalAlignment','left', ...
wolffd@0 544 'Style','text', ...
wolffd@0 545 'String','Title'),'units','normalized');
wolffd@0 546
wolffd@0 547 pr = udata.property{indx};
wolffd@0 548 ed_h = uicontrol( ... %% [edit]
wolffd@0 549 'Units','pixels', ...
wolffd@0 550 'Position',title_pos, ...
wolffd@0 551 'Style','edit', ...
wolffd@0 552 'FontSize',12, ...
wolffd@0 553 'String',pr{1}, ...
wolffd@0 554 'BackgroundColor',bg_color2);
wolffd@0 555 set(ed_h,'units','normalized');
wolffd@0 556
wolffd@0 557 set( ...
wolffd@0 558 uicontrol( ... %% [frame]
wolffd@0 559 'Units','pixels', ...
wolffd@0 560 'Position',frame2_pos, ...
wolffd@0 561 'Style','frame'),'units','normalized');
wolffd@0 562
wolffd@0 563 s = ['vis_show_gui_comp(', ...
wolffd@0 564 mat2str(h) ',' mat2str(indx), ...
wolffd@0 565 ',''empty'',' mat2str(fig_h) ')'];
wolffd@0 566 set( ...
wolffd@0 567 uicontrol( ... %% OK
wolffd@0 568 'Units','pixels', ...
wolffd@0 569 'Position',ok_pos, ...
wolffd@0 570 'String','OK', ...
wolffd@0 571 'Callback',s),'units','normalized');
wolffd@0 572
wolffd@0 573 set( ...
wolffd@0 574 uicontrol( ... %% Cancel
wolffd@0 575 'Units','pixels', ...
wolffd@0 576 'Position',cancel_pos, ...
wolffd@0 577 'String','Cancel', ...
wolffd@0 578 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized');
wolffd@0 579
wolffd@0 580 watchoff(old_fig_n);
wolffd@0 581 tmp_udata = [ed_h];
wolffd@0 582 set(fig_h,'units','normalized', ...
wolffd@0 583 'Visible','on', ...
wolffd@0 584 'UserData', tmp_udata, ...
wolffd@0 585 'handlevisibility','off');
wolffd@0 586
wolffd@0 587 end
wolffd@0 588
wolffd@0 589 %%%%%%
wolffd@0 590 % comp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 591 %%%%%%
wolffd@0 592 elseif (strcmp(action,'comp'))
wolffd@0 593 tmp_h = get(varargin{1},'UserData');
wolffd@0 594 v = get(tmp_h,'Value');
wolffd@0 595 pr = udata.property{indx};
wolffd@0 596 if (v)
wolffd@0 597 v = 'compi';
wolffd@0 598 pr{1} = 1;
wolffd@0 599 else
wolffd@0 600 v = 'comp';
wolffd@0 601 pr{1} = 0;
wolffd@0 602 end
wolffd@0 603 plot_array(indx).args{1} = v;
wolffd@0 604 udata.plot_array = plot_array;
wolffd@0 605 udata.property{indx} = pr;
wolffd@0 606 set(h,'UserData',udata);
wolffd@0 607 close(varargin{1});
wolffd@0 608
wolffd@0 609 %%%%%%
wolffd@0 610 % umat %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 611 %%%%%%
wolffd@0 612 elseif (strcmp(action,'umat'))
wolffd@0 613 tmp_h = get(varargin{1},'UserData');
wolffd@0 614 v = get(tmp_h(1),'Value');
wolffd@0 615 pr = udata.property{indx};
wolffd@0 616 if (v)
wolffd@0 617 v = 'umati';
wolffd@0 618 pr{1} = 1;
wolffd@0 619 else
wolffd@0 620 v = 'umat';
wolffd@0 621 pr{1} = 0;
wolffd@0 622 end
wolffd@0 623 plot_array(indx).args{1} = v;
wolffd@0 624
wolffd@0 625 s = get(tmp_h(2),'String');
wolffd@0 626 v = get(tmp_h(3),'Value'); % userdata
wolffd@0 627 plot_array(indx).string = s;
wolffd@0 628 if strcmp(s,'U-matrix')
wolffd@0 629 plot_array(indx).args{2} = v;
wolffd@0 630 else
wolffd@0 631 plot_array(indx).args{2} = {v s};
wolffd@0 632 end
wolffd@0 633 pr{2} = s;
wolffd@0 634 pr{3} = v;
wolffd@0 635 udata.plot_array = plot_array;
wolffd@0 636 udata.property{indx} = pr;
wolffd@0 637 set(h,'UserData',udata);
wolffd@0 638 set(udata.h(1),'String',{plot_array(:).string});
wolffd@0 639 close(varargin{1});
wolffd@0 640
wolffd@0 641 %%%%%%%
wolffd@0 642 % color %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 643 %%%%%%%
wolffd@0 644 elseif (strcmp(action,'color'))
wolffd@0 645 tmp_h = get(varargin{1},'UserData'); % tmp_h = [chkb_h ed_h popup1_h];
wolffd@0 646
wolffd@0 647 v = get(tmp_h(1),'Value');
wolffd@0 648 pr = udata.property{indx};
wolffd@0 649 if (v)
wolffd@0 650 v = 'colori';
wolffd@0 651 pr{1} = 1;
wolffd@0 652 else
wolffd@0 653 v = 'color';
wolffd@0 654 pr{1} = 0;
wolffd@0 655 end
wolffd@0 656 plot_array(indx).args{1} = v;
wolffd@0 657
wolffd@0 658 v = get(tmp_h(3),'Value');
wolffd@0 659 s = get(tmp_h(3),'string');
wolffd@0 660 if v>5 & ~strcmp(s{v},'-variable-'),
wolffd@0 661 m = evalin('base',s{v});
wolffd@0 662 elseif ~strcmp(s{v},'-variable-'),
wolffd@0 663 m = som_colorcode(udata.sM,s{v});
wolffd@0 664 end
wolffd@0 665 plot_array(indx).args{2} = m;
wolffd@0 666 pr{3} = s;
wolffd@0 667 s = get(tmp_h(2),'String');
wolffd@0 668 plot_array(indx).string = s;
wolffd@0 669 if ~strcmp(s,'Color code')
wolffd@0 670 plot_array(indx).args{2} = ...
wolffd@0 671 {plot_array(indx).args{2} s};
wolffd@0 672 end
wolffd@0 673 pr{2} = s;
wolffd@0 674 pr{4} = v;
wolffd@0 675 udata.plot_array = plot_array;
wolffd@0 676 udata.property{indx} = pr;
wolffd@0 677 set(h,'UserData',udata);
wolffd@0 678 set(udata.h(1),'String',{plot_array(:).string});
wolffd@0 679 close(varargin{1});
wolffd@0 680
wolffd@0 681 %%%%%%%
wolffd@0 682 % empty %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 683 %%%%%%%
wolffd@0 684 elseif (strcmp(action,'empty'))
wolffd@0 685 pr = udata.property{indx};
wolffd@0 686 tmp_h = get(varargin{1},'UserData');
wolffd@0 687 s = get(tmp_h,'String');
wolffd@0 688 pr{1} = s;
wolffd@0 689 plot_array(indx).string = s;
wolffd@0 690 plot_array(indx).args{2} = s;
wolffd@0 691 udata.plot_array = plot_array;
wolffd@0 692 udata.property{indx} = pr;
wolffd@0 693 set(h,'UserData',udata);
wolffd@0 694 set(udata.h(1),'String',{plot_array(:).string});
wolffd@0 695 close(varargin{1});
wolffd@0 696
wolffd@0 697 else
wolffd@0 698
wolffd@0 699 end
wolffd@0 700
wolffd@0 701
wolffd@0 702