📄 vis_show_gui_tool.m
字号:
'handlevisibility','off'); %%%%%%%%%%%%% recolorbar %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%elseif strcmp(action,'recolorbar') old_fig_n = watchon; W = 345.4; H = 237.299; o25 = zeros(1,4); o25(1) = (W-f_fr(3))/2; f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14]; hint_txt = [W 18.45]; % hint text width and height units = get(h,'units'); set(h,'units','pixels'); fp = get(h,'Position'); fig_pos = [(fp(1)+fp(3)) ... (fp(2)+fp(2)+fp(4)/2-H/2) ... W ... H]; o1 = sum(f_fr([2 4]))+frames_dist; o2 = o1+dist1; o6 = max([title_txt(2),var_pop(2)]); o7 = max([title_txt(2),title_edit_h]); o8 = max([title_txt(2),title_edit_h,selvar_pb(2)]); o20 = ok_pb(1)+title_txt(1); o10 = o20+var_pop(1)+2*dist1; o11 = o10+title_txt(1); o3 = o6+2*dist1; o4 = o1+dist1+0.5*o6-title_txt(2)/2; o5 = o1+dist1+0.5*o6-var_pop(2)/2; o9 = o1+o3+frames_dist2; o12 = 2*o8+3*dist1; o13 = o9+dist1+0.5*o8-title_txt(2)/2; o14 = o9+dist1+0.5*o8-title_edit_h/2; o15 = o9+dist1+0.5*o8-var_pop(2)/2; o16 = o9+2*dist1+1.5*o8-title_txt(2)/2; o17 = o9+2*dist1+1.5*o8-title_edit_h/2; o18 = o9+2*dist1+1.5*o8-var_pop(2)/2; o19 = o9+o12+frames_dist2; o21 = o7+2*dist1; o22 = o19+dist1+0.5*o7-title_txt(2)/2; o23 = o19+dist1+0.5*o7-title_edit_h/2; o24 = o19+o21+hint_dist1; hint_text_pos = [1 o24 hint_txt]; frame1_pos = [f_fr(1) o19 f_fr(3) o21]; subplots_text_pos = [ok_pb(1) o22 title_txt]; subplots_pos = [o20 o23 strd_ed]; frame2_pos = [f_fr(1) o9 f_fr(3) o12]; tics_text_pos = [ok_pb(1) o16 title_txt]; tics_pos = [o20 o17 strd_ed]; sel_var2_pos = [o10 o18 var_pop]; labels_text_pos = [ok_pb(1) o13 title_txt]; labels_pos = [o20 o14 strd_ed]; sel_var1_pos = [o10 o15 var_pop]; frame3_pos = [f_fr(1) o1 f_fr(3) o3]; scale_text_pos = [ok_pb(1) o4 title_txt]; scale_pos = [o20 o5 1.3*var_pop(1) var_pop(2)]; f_fr = [7.9 8.38 216.2 36.9]; % final frame cancel_pb = [139 15.76 75.9 22.14]; frame4_pos = f_fr+o25; ok_pos = ok_pb+o25; cancel_pos = cancel_pb+o25; fig_h = figure( ... 'Units','pixels', ... 'Position', fig_pos, ... 'Color',fig_color, ... 'NumberTitle','off', ... 'Name','recolorbar', ... 'MenuBar','none', ... 'Visible','off'); set( ... uicontrol( ... %% hint 'Units','pixels', ... 'BackgroundColor',fig_color, ... 'HorizontalAlignment','center', ... 'Position',hint_text_pos, ... 'String','Options, recolorbar', ... 'Style','text'),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame1_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% In subplot(s) 'Units','pixels', ... 'Position',subplots_text_pos, ... 'HorizontalAlignment','left', ... 'String','In subplot(s)', ... 'Style','text'),'units','normalized'); ed1_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',subplots_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed1_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame2_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Ticks 'Units','pixels', ... 'Position',tics_text_pos, ... 'HorizontalAlignment','left', ... 'String','Ticks', ... 'Style','text'),'units','normalized'); ed3_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',tics_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed3_h,'units','normalized'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool(tmp(3),''select'')']; set( ... uicontrol( ... %% Select variable 'Units','pixels', ... 'Position',sel_var2_pos, ... 'String','Select variable', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% Labels (cell array) 'Units','pixels', ... 'Position',labels_text_pos, ... 'HorizontalAlignment','left', ... 'String','Labels', ... 'Style','text'),'units','normalized'); ed2_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',labels_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed2_h,'units','normalized'); s = ['tmp=get(' mat2str(fig_h) ',''userdata'');' ... 'vis_show_gui_tool(tmp(2),''select'')']; set( ... uicontrol( ... %% Select variable 'Units','pixels', ... 'Position',sel_var1_pos, ... 'String','Select variable', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame3_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% Scale 'Units','pixels', ... 'Position',scale_text_pos, ... 'HorizontalAlignment','left', ... 'String','Scale', ... 'Style','text'),'units','normalized'); s = {'denormalized' 'normalized'}; p1_h = uicontrol( ... %% [popupmenu] 'Units','pixels', ... 'Position',scale_pos, ... 'String',s, ... 'Style','popupmenu'); set(p1_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame4_pos, ... 'Style','frame'),'units','normalized'); s = ['vis_show_gui_tool(' mat2str(h) ',''do_recolorbar'',' mat2str(fig_h) ')']; set( ... uicontrol( ... %% OK 'Units','pixels', ... 'Position',ok_pos, ... 'String','OK', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% Cancel 'Units','pixels', ... 'Position',cancel_pos, ... 'String','Cancel', ... 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized'); watchoff(old_fig_n); tmp_udata = [ed1_h ed2_h ed3_h p1_h]; set(fig_h,'units','normalized', ... 'Visible','on', ... 'UserData',tmp_udata, ... 'handlevisibility','off'); %%%%%%%% clear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%elseif strcmp(action,'clear') old_fig_n = watchon; W = 232; H = 277.463; o25 = zeros(1,4); o25(1) = (W-f_fr(3))/2; f_fr = [7.9 8.38 (W-2*7.9) 36.9]; % final frame cancel_pb = [(W-(ok_pb(1)+75.9)) 15.76 75.9 22.14]; hint_txt = [W 18.45]; % hint text width and height units = get(h,'units'); set(h,'units','pixels'); fp = get(h,'Position'); fig_pos = [(fp(1)+fp(3)) ... (fp(2)+fp(2)+fp(4)/2-H/2) ... W ... H]; o1 = sum(f_fr([2 4]))+frames_dist; o2 = o1+dist1; o3 = (W-radio_rb(1))/2; o4 = o2+radio_rb(2)+dist1; o5 = o4+radio_rb(2)+dist1; o6 = o5+radio_rb(2)+dist1; o7 = o6+radio_rb(2)+dist1; o8 = 5*radio_rb(2)+6*dist1; o9 = o1+o8+frames_dist2; o10 = max([title_txt(2),title_edit_h]); o11 = o9+dist1+0.5*o10-title_txt(2)/2; o12 = o9+dist1+0.5*o10-strd_ed(2)/2; o20 = W-(ok_pb(1)+strd_ed(1)); o13 = o10+2*dist1; o24 = o9+o13+hint_dist1; hint_text_pos = [1 o24 hint_txt]; frame1_pos = [f_fr(1) o9 f_fr(3) o13]; subplots_text_pos = [ok_pb(1) o11 title_txt]; subplots_pos = [o20 o12 strd_ed]; frame2_pos = [f_fr(1) o1 f_fr(3) o8]; radiob1_pos = [o3 o7 selvar_pb]; radiob2_pos = [o3 o6 selvar_pb]; radiob3_pos = [o3 o5 selvar_pb]; radiob4_pos = [o3 o4 selvar_pb]; radiob5_pos = [o3 o2 selvar_pb]; f_fr = [7.9 8.38 216.2 36.9]; % final frame cancel_pb = [139 15.76 75.9 22.14]; frame3_pos = f_fr;%+o25; ok_pos = ok_pb;%+o25; cancel_pos = cancel_pb;%+o25; fig_h = figure( ... 'Units','pixels', ... 'Position', fig_pos, ... 'Color',fig_color, ... 'NumberTitle','off', ... 'Name','clear label', ... 'MenuBar','none', ... 'Visible','off'); set( ... uicontrol( ... %% hint 'Units','pixels', ... 'BackgroundColor',fig_color, ... 'HorizontalAlignment','center', ... 'Position',hint_text_pos, ... 'String','Options for clearing', ... 'Style','text'),'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame1_pos, ... 'Style','frame'),'units','normalized'); set( ... uicontrol( ... %% From subplots 'Units','pixels', ... 'Position',subplots_text_pos, ... 'String','From subplots', ... 'Style','text'),'units','normalized'); ed1_h = uicontrol( ... %% [edit] 'Units','pixels', ... 'BackgroundColor',bg_color2, ... 'Position',subplots_pos, ... 'FontSize',12, ... 'Style','edit'); set(ed1_h,'units','normalized'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame2_pos, ... 'Style','frame'),'units','normalized'); rb1_h = uicontrol( ... %% 'Units','pixels', ... 'Position',radiob1_pos, ... 'style','radiobutton', ... 'String','All', ... 'value',1); rb2_h = uicontrol( ... %% 'Units','pixels', ... 'Position',radiob2_pos, ... 'style','radiobutton', ... 'String','Comet'); rb3_h = uicontrol( ... %% 'Units','pixels', ... 'Position',radiob3_pos, ... 'style','radiobutton', ... 'String','Hit'); rb4_h = uicontrol( ... %% 'Units','pixels', ... 'Position',radiob4_pos, ... 'style','radiobutton', ... 'String','Label'); rb5_h = uicontrol( ... %% 'Units','pixels', ... 'Position',radiob5_pos, ... 'style','radiobutton', ... 'String','Trajectory'); set( ... uicontrol( ... %% [frame] 'Units','pixels', ... 'Position',frame3_pos, ... 'Style','frame'),'units','normalized'); s = ['vis_show_gui_tool(' mat2str(h) ',''c_clear'',' mat2str(fig_h) ')']; set( ... uicontrol( ... %% OK 'Units','pixels', ... 'Position',ok_pos, ... 'String','OK', ... 'Callback',s),'units','normalized'); set( ... uicontrol( ... %% Cancel 'Units','pixels', ... 'Position',cancel_pos, ... 'String','Cancel', ... 'Callback',['close(' mat2str(fig_h) ')']),'units','normalized'); watchoff(old_fig_n); tmp_udata = [ed1_h rb1_h rb2_h rb3_h rb4_h rb5_h]; set(fig_h,'units','normalized', ... 'Visible','on', ... 'UserData',tmp_udata, ... 'handlevisibility','off'); %%%%%%%%%% c_clear %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%elseif strcmp(action,'c_clear') thisfig = varargin{1}; u = get(varargin{1},'UserData'); s = get(u(1),'String'); if ~isempty(s) if s(1)=='[' | (s(1)>='1' & s(1)<='9') sprintf(s,'[%s]',s); e = eval(s); else e = s; end if vis_valuetype(e,{'1xn','nx1','string'}), if ischar(e), if ~strcmp(e,'all'), errordlg({'Only valid string value' ... 'for subplot indices is ''all''.'}, ... 'Error in SOM_VIS: tools'); return; else e=1:length(handles); end elseif any(e<1) | any(e>length(handles)), errordlg({'Subplot indices must be in', ... 'range 1...number_of_subplots!'}, ... 'Error in SOM_VIS: tools'); return; end elseif ~isempty(e) errordlg('Invalid subplot indices!','Error in SOM_VIS: tools'); return; end else, e = ''; end set(0,'currentfigure',child) v = get(u(2),'value'); if v, if ~isempty(e), som_show_clear('lab',e);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -