Contents   Functions      PDF Index |
Purpose
Base SDT gui figure handling.
Description
This function is used to implement base SDT mechanisms for tabs shown in JAVA GUI. It also supports advanced structure manipulations (stored here due to interactions with structure like objects aka handles and other SDT objects)
Commands for tab initialisation/refreshing. InitPTree is an example of initialization of the navigation pane. InitProject implements the typical project tab which is detailed in section 8.1.2. InitPref opens the SDT preference editor.
Commands for property setting. Implements SetPref for preferences, SetProject for generic project parameters and and generic setting of fields defined in PARAM.
The default mechanism for set is to specify the tab in the command and provide data to be set a structure where each field describes a cell in the tab. An example for the Project tab.
tdir=sdtdef('tempdir'); sdtroot('SetProject',struct('ProjectWd',tdir, ... % Root file location 'PlotWd',fullfile(tdir,'plots'), ... % Plot directory 'PlotWord',fullfile(tdir,'tmp_word.docx'))); % Word file for image insert
PARAM commands are used to retrieve data stored normally stored in the userdata of the project figure.
st=sdtroot('PARAM.Project.ProjectWd -safe') r1=sdtroot('PARAM.Project')
Each project figure supports a dictionnary (or OsDic) of named comgui objSet styles that can be used to format figures, images, ... The following illustrates simple manipulations, for a list of usual categories see section 8.1.
% Sample style definition, see examples in d_imw my_style={'position',[NaN,NaN,1087,384],'@line',{'linewidth',5}}; sdtroot('InitOsDic'); % Display list of named styles sdtroot('setOsDic',{'ImMyStyle',my_style}) % Associate ImMyStyle name to this style figure(1);plot([0 1]); comgui('objset',1,{'@OsDic(SDT Root)','ImMyStyle'}); % Apply named style
Subcommand sfield provides structure manipulation utilities. It can be accessed by calling sfield=sdtroot('@sfield');.
The following commands are available
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); r2=struct('Opt','ttt','other','value'); r1=feval(sdtroot('@sfield'),'AddMissing',r1,r2);
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); r2=struct('Opt','ttt','other','value','field',true); r1=feval(sdtroot('@sfield'),'AddSelected',r1,r2,{'field'});
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); r2=struct('Opt','ttt'); r1=feval(sdtroot('@sfield'),'AddIncF',r1,r2);
list={'tag',{'value','test'},'opt',1}; r1=feval(sdtroot('@sfield'),'Cell2Struct',list);
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); v1=feval(sdtroot('@sfield'),'GetField',r1,'postname','field'); f1=feval(sdtroot('@sfield'),'GetField',r1,'postname','name');
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); r2=struct('opt','ttt','other','value'); r1=feval(sdtroot('@sfield'),'MergeI',r1,r2);
r1=struct('PostCheck',1,'Opt','test','PostName','NameP','run',true); r2=feval(sdtroot('@sfield'),'Sub',r1,'^Post',1);