Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plscmd/plotroi/rri_file_menu.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

function rri_file_menu(action, varargin)

if isnumeric(action)
if isnumeric(action) || isgraphics(action)
fig = action;
action = 'init';
end
Expand Down
11 changes: 9 additions & 2 deletions plscmd/plotroi/rri_txtbox.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
%
try
txtbox_hdl = findobj(CurrentFigure, 'tag', 'rri_txtbox');
if txtbox_hdl, delete(txtbox_hdl); end;
if isvalid(txtbox_hdl), delete(txtbox_hdl); end;
catch
end

Expand Down Expand Up @@ -116,7 +116,6 @@
'FontWeight', fntweight, ...
'FontSize', fnt, ...
'box','on', ...
'drawmode','fast', ...
'nextplot','add', ...
'xtick', [-1], ...
'ytick', [-1], ...
Expand All @@ -125,6 +124,14 @@
'tag','rri_txtbox', ...
'position', pos);

% to avoid "The DrawMode property will be removed in a future release" warning in R2014b
if verLessThan('matlab', '8.4.0') % R2014b
set(txtbox_hdl,'drawmode', 'fast');
else
set(txtbox_hdl,'sortmethod', 'childorder');
end


if ishandle(varargin{1})
items = (nargin-1)/2;
for i=1:items
Expand Down
6 changes: 3 additions & 3 deletions plsgui/bfm_analysis_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ function Init()
group_hdls = [g_h1, g_h2, g_h3, g_h4];
setappdata(h0,'Group_hlist',group_hdls);

group_template = copyobj(group_hdls,h0);
group_template = copyobj_legacy(group_hdls,h0);
set(group_template,'visible','off','Tag','GroupUIControls');

setappdata(h0,'GroupTemplate',group_template);
Expand Down Expand Up @@ -1172,7 +1172,7 @@ function SetupGroupRows()
group_hdls = group_hdls(1:rows,:);
else % add new rows
for i=nr+1:rows,
new_g_hdls = copyobj(group_template,gcf);
new_g_hdls = copyobj_legacy(group_template,gcf);
group_hdls = [group_hdls; new_g_hdls'];
end;
end;
Expand Down Expand Up @@ -1275,7 +1275,7 @@ function CreateAddRow()

group_template = getappdata(gcf,'GroupTemplate');

a_hdls = copyobj(group_template,gcf);
a_hdls = copyobj_legacy(group_template,gcf);

set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ...
'UserData',1);
Expand Down
8 changes: 4 additions & 4 deletions plsgui/bfm_hrf_input_condition_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ function init(old_conditions,old_condition_baseline,protected_conds)
cond1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; % save handles for condition#1
setappdata(h0,'Cond_hlist',cond1_hdls);

cond_template = copyobj(cond1_hdls,h0);
cond_template = copyobj_legacy(cond1_hdls,h0);
set(cond_template,'visible','off');

setappdata(h0,'ProtectedConditions',protected_conds);
Expand Down Expand Up @@ -424,15 +424,15 @@ function SetupConditionRows()
cond_hdls = cond_hdls(1:rows,:);
else % add new rows to 'rows' amount
for i=nr+1:rows,
new_c_hdls = copyobj(cond_template,gcf);
new_c_hdls = copyobj_legacy(cond_template,gcf);
cond_hdls = [cond_hdls; new_c_hdls'];
end;
end

v = 'off';
for i=1:rows
% take out the handle list created above, and use it in the following 'label,edit,delete'.
% those handles are valid, since they are all obtained from function copyobj() above.
% those handles are valid, since they are all obtained from function copyobj_legacy() above.
new_c_hdls = cond_hdls(i,:);

% init label
Expand Down Expand Up @@ -540,7 +540,7 @@ function CreateAddRow()

cond_template = getappdata(gcf,'ConditionTemplate');

a_hdls = copyobj(cond_template,gcf);
a_hdls = copyobj_legacy(cond_template,gcf);

set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ...
'UserData',1);
Expand Down
4 changes: 2 additions & 2 deletions plsgui/bfm_hrf_input_run_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ function init(run_info,num_runs,conditions),

setappdata(gcf,'DataDirectory',curr);

onset_template = copyobj([t1 t2 t3 t4 t5],h0);
onset_template = copyobj_legacy([t1 t2 t3 t4 t5],h0);
set(onset_template(1),'Tag','ConditionNameLabelTemplate','Visible','off');
set(onset_template(2),'Tag','BlockOnsetEditTemplate','Visible','off');
set(onset_template(3),'Tag','BlockLengthEditTemplate','Visible','off');
Expand Down Expand Up @@ -704,7 +704,7 @@ function SetupBlockOnsetRows()
onset_hdls = onset_hdls(1:rows,:);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(onset_template,gcf);
new_s_hdls = copyobj_legacy(onset_template,gcf);
onset_hdls = [onset_hdls; new_s_hdls'];
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions plsgui/bfm_input_run_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ function init(run_info,num_runs,conditions),

setappdata(gcf,'DataDirectory',curr);

onset_template = copyobj([t1 t2 t3 t4 t5],h0);
onset_template = copyobj_legacy([t1 t2 t3 t4 t5],h0);
set(onset_template(1),'Tag','ConditionNameLabelTemplate','Visible','off');
set(onset_template(2),'Tag','BlockOnsetEditTemplate','Visible','off');
set(onset_template(3),'Tag','BlockLengthEditTemplate','Visible','off');
Expand Down Expand Up @@ -684,7 +684,7 @@ function SetupBlockOnsetRows()
onset_hdls = onset_hdls(1:rows,:);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(onset_template,gcf);
new_s_hdls = copyobj_legacy(onset_template,gcf);
onset_hdls = [onset_hdls; new_s_hdls'];
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions plsgui/bfm_plot_brain_scores.m
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
'tag','LegendMenu');
% 'sepa','on', ...

lv_template = copyobj(lv_h,hh);
lv_template = copyobj_legacy(lv_h,hh);
set(lv_template,'Tag','LVTemplate','Visible','off');

% load the brain scores, conditions, evt_list
Expand Down Expand Up @@ -415,7 +415,7 @@ function SetupLVButtonRows()
lv_hdls = lv_hdls(1:rows);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(lv_template,gcf);
new_s_hdls = copyobj_legacy(lv_template,gcf);
lv_hdls = [lv_hdls; new_s_hdls'];
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions plsgui/bfm_plot_rf.m
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ function plot_response_fn()
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 0);
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);
Expand Down Expand Up @@ -1387,7 +1387,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin)
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(cond_name, 0);
[l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);
Expand Down
6 changes: 3 additions & 3 deletions plsgui/bfm_plot_rf_task.m
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ function plot_response_fn()
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 0);
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location','northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);
Expand Down Expand Up @@ -1717,7 +1717,7 @@ function set_cond_axes(num_rows,num_cols,axes_margin)
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(cond_name, 0);
[l_hdl, o_hdl] = legend(cond_name, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);
Expand Down Expand Up @@ -2402,7 +2402,7 @@ function plot_response_fn_resid()
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 0);
[l_hdl, o_hdl] = legend(intensity_legend, subjects, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl',[{l_hdl} {o_hdl}]);
Expand Down
8 changes: 4 additions & 4 deletions plsgui/bfm_plot_scores_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function bfm_plot_scores_ui(varargin)
% set(hh,'Name',sprintf('PLS Scores Plot: %s',PLSresultFile));
% end;

lv_template = copyobj(lv_h,gcf);
lv_template = copyobj_legacy(lv_h,gcf);
set(lv_template,'Tag','LVTemplate','Visible','off');

[b_scores,d_scores,designlv,s,perm_result,conditions, ...
Expand Down Expand Up @@ -434,7 +434,7 @@ function SetupLVButtonRows()
lv_hdls = lv_hdls(1:rows);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(lv_template,gcf);
new_s_hdls = copyobj_legacy(lv_template,gcf);
lv_hdls = [lv_hdls; new_s_hdls'];
end;
end;
Expand Down Expand Up @@ -781,7 +781,7 @@ function PlotDesignScores()
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(conditions, 0);
[l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl2',[{l_hdl} {o_hdl}]);
Expand Down Expand Up @@ -912,7 +912,7 @@ function PlotDesignLV()
end;

% create a new legend, and save the handles
[l_hdl, o_hdl] = legend(conditions, 0);
[l_hdl, o_hdl] = legend(conditions, 'Location', 'northeast');
legend_txt(o_hdl);
set(l_hdl,'color',[0.9 1 0.9]);
setappdata(gcf,'LegendHdl3',[{l_hdl} {o_hdl}]);
Expand Down
21 changes: 21 additions & 0 deletions plsgui/copyobj_legacy.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%
% copyobj_legacy
%
% workaround for changed behaviour of copyobj in Matlab 2014b
%
% new_handle = copyobj(h,p)
% copyobj(___,'legacy')
%
% Copy graphics objects and their descendants
%
% copyobj(___,'legacy') copies object callback properties and object application data.
% This behavior is consistent with versions of copyobj before Matlab release R2014b.
%

function template = copyobj_legacy(source_hdl,parent_hdl)
if verLessThan('matlab', '8.4.0') % R2014b
template = copyobj(source_hdl, parent_hdl);
else
template = copyobj(source_hdl, parent_hdl, 'legacy');
end
end
6 changes: 3 additions & 3 deletions plsgui/erp_analysis_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ function init()
group_hdls = [g_h1, g_h2, g_h3, g_h4];
setappdata(h0,'Group_hlist',group_hdls);

group_template = copyobj(group_hdls,h0);
group_template = copyobj_legacy(group_hdls,h0);
set(group_template,'visible','off','Tag','GroupUIControls');
setappdata(h0,'GroupTemplate',group_template);

Expand Down Expand Up @@ -1204,7 +1204,7 @@ function SetupGroupRows()
group_hdls = group_hdls(1:rows,:);
else % add new rows
for i=nr+1:rows,
new_g_hdls = copyobj(group_template,gcf);
new_g_hdls = copyobj_legacy(group_template,gcf);
group_hdls = [group_hdls; new_g_hdls'];
end;
end;
Expand Down Expand Up @@ -1318,7 +1318,7 @@ function CreateAddRow()
group_template = getappdata(gcf,'GroupTemplate');
buttondown_group = 'erp_analysis_ui(''BUTTONDOWN_GROUP'');';

a_hdls = copyobj(group_template,gcf);
a_hdls = copyobj_legacy(group_template,gcf);

set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','on', ...
'UserData',1); % empty string
Expand Down
8 changes: 4 additions & 4 deletions plsgui/erp_input_diff_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
couple1_hdls = [c_h1,c_h2,c_h3,c_h4,c_h5]; % save handles for row
setappdata(h01,'couple_hlist',couple1_hdls);

couple_template = copyobj(couple1_hdls,h01);
couple_template = copyobj_legacy(couple1_hdls,h01);
set(couple_template,'visible','off');

setappdata(h01,'old_couple_lst',old_couple_lst);
Expand Down Expand Up @@ -336,15 +336,15 @@ function SetupCoupleRows()
couple_hdls = couple_hdls(1:rows,:);
else % add new rows to 'rows' amount
for i=nr+1:rows,
new_c_hdls = copyobj(couple_template,gcf);
new_c_hdls = copyobj_legacy(couple_template,gcf);
couple_hdls = [couple_hdls; new_c_hdls'];
end;
end

v = 'off';
for i=1:rows
% take out the handle list created above, and use it in the following 'label,edit,delete'.
% those handles are valid, since they are all obtained from function copyobj() above.
% those handles are valid, since they are all obtained from function copyobj_legacy() above.
new_c_hdls = couple_hdls(i,:);

% init label
Expand Down Expand Up @@ -442,7 +442,7 @@ function CreateAddRow()
edit_cbf = [edit_cbf, '''Use Add Button to add condition couple'');'];

couple_template = getappdata(gcf,'couple_template');
a_hdls = copyobj(couple_template,gcf);
a_hdls = copyobj_legacy(couple_template,gcf);


set(a_hdls(1),'String','','Foreground',[0.4 0.4 0.4],'Visible','off', ...
Expand Down
4 changes: 2 additions & 2 deletions plsgui/erp_new_axis_ui.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
rri_file_menu(h01);

h0 = gcbf;
copy_axis = copyobj(old_axis, h0);
new_axis = copyobj(copy_axis, h01);
copy_axis = copyobj_legacy(old_axis, h0);
new_axis = copyobj_legacy(copy_axis, h01);
delete(copy_axis);
set(new_axis, 'position', [.08 .12 .86 .8]);

Expand Down
4 changes: 2 additions & 2 deletions plsgui/erp_plot_brain_scores.m
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
'Callback','pet_plot_cond_stim_ui(''CHANGE_PLOT_DIMS'');');


lv_template = copyobj(lv_h,hh);
lv_template = copyobj_legacy(lv_h,hh);
set(lv_template,'Tag','LVTemplate','Visible','off');

setappdata(hh,'result_file',plsResultFile);
Expand Down Expand Up @@ -395,7 +395,7 @@ function SetupLVButtonRows()
lv_hdls = lv_hdls(1:rows);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(lv_template,gcf);
new_s_hdls = copyobj_legacy(lv_template,gcf);
lv_hdls = [lv_hdls; new_s_hdls'];
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions plsgui/erp_plot_canonical_corr.m
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
get_st_datamat_filename(plsResultFile);
make_datamat_popup(1);

lv_template = copyobj(lv_h,hh);
lv_template = copyobj_legacy(lv_h,hh);
set(lv_template,'Tag','LVTemplate','Visible','off');

[brainlv,conditions,cond_selection,chan_selection, ...
Expand Down Expand Up @@ -380,7 +380,7 @@ function SetupLVButtonRows()
lv_hdls = lv_hdls(1:rows);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(lv_template,gcf);
new_s_hdls = copyobj_legacy(lv_template,gcf);
lv_hdls = [lv_hdls; new_s_hdls'];
end;
end;
Expand Down
4 changes: 2 additions & 2 deletions plsgui/erp_plot_canonical_scores.m
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
get_st_datamat_filename(plsResultFile);
make_datamat_popup(1);

lv_template = copyobj(lv_h,hh);
lv_template = copyobj_legacy(lv_h,hh);
set(lv_template,'Tag','LVTemplate','Visible','off');

[brainlv,conditions,cond_selection,chan_selection,common_time_info] = ...
Expand Down Expand Up @@ -382,7 +382,7 @@ function SetupLVButtonRows()
lv_hdls = lv_hdls(1:rows);
else % add more rows
for i=nr+1:rows,
new_s_hdls = copyobj(lv_template,gcf);
new_s_hdls = copyobj_legacy(lv_template,gcf);
lv_hdls = [lv_hdls; new_s_hdls'];
end;
end;
Expand Down
Loading