Browse EVRIGUI Object: Difference between revisions
imported>Jeremy (Created page with '__TOC__ These are the methods defined for the Workspace Browser when accessed through an EVRIGUI object. The following methods are called by referring to th…') |
imported>Jeremy No edit summary |
||
Line 11: | Line 11: | ||
== | ==Working with Objects and Shortcuts== | ||
These methods can be used to retrieve and work with the objects and shortcuts currently available in the workspace. The methods which return outputs here (the .get methods) return an array of strings. Accessing these objects (e.g. using the .open method described below) must be done using the string exactly as returned from the .get methods. | |||
These methods can be used to | |||
{| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em" |- | {| border="1" cellspacing="0" cellpadding="5" style="margin-left:3em" |- | ||
| <tt>. | | <tt>.getObjects</tt> || Retrieves the list of current objects (datasets, models, etc) in the workspace | ||
|- | |- | ||
| <tt>. | | <tt>.getShortcuts</tt> || Retrieves the list of shortcuts (i.e. links to start particular analysis tools) visibile in the workspace. If the user has deselected shortcuts using the choose shortcuts preferences, only the ones turned on will be listed here. | ||
|- | |- | ||
| <tt>. | | <tt>.open('object')</tt> || Where object is a string naming either a shortcut or an object in the workspace, this method opens the specified object in the appropriate editor or interface or instances a new interface when the string specifies a shortcut. | ||
|- | |- | ||
| <tt>. | | <tt>.update</tt> || Refreshses the interface and list of available objects and shortcuts. A call to this method is recommended when outside programs or interfaces may have created new objects in the workspace. It should be called just prior to one of the .get methods listed here. | ||
|} | |} | ||
Revision as of 12:32, 19 February 2010
These are the methods defined for the Workspace Browser when accessed through an EVRIGUI object. The following methods are called by referring to the given EVRIGUI object, followed by the method to be accessed. For example, given an EVRIGUI object in the workspace called "obj", the following call retrieves the list of currently displayed shortcuts in the workspace:
list = obj.getShortcuts;
And this would open (i.e. start up) the shortcut labeled "Decompose (PCA)":
obj.open('Decompose (PCA)');
The specific methods available are described in the sections below.
Working with Objects and Shortcuts
These methods can be used to retrieve and work with the objects and shortcuts currently available in the workspace. The methods which return outputs here (the .get methods) return an array of strings. Accessing these objects (e.g. using the .open method described below) must be done using the string exactly as returned from the .get methods.
.getObjects | Retrieves the list of current objects (datasets, models, etc) in the workspace |
.getShortcuts | Retrieves the list of shortcuts (i.e. links to start particular analysis tools) visibile in the workspace. If the user has deselected shortcuts using the choose shortcuts preferences, only the ones turned on will be listed here. |
.open('object') | Where object is a string naming either a shortcut or an object in the workspace, this method opens the specified object in the appropriate editor or interface or instances a new interface when the string specifies a shortcut. |
.update | Refreshses the interface and list of available objects and shortcuts. A call to this method is recommended when outside programs or interfaces may have created new objects in the workspace. It should be called just prior to one of the .get methods listed here. |
Generic GUI Methods
These methods provide simple access to simple GUI actions such as controlling the visibility of the GUI and closing or creating the GUI
.close | Forces the GUI to close |
.create | Used to create a new Workspace Browser - NOTE: This method is called automatically by the main EVRIGUI object and should not be called directly by the user (an error will always be thrown in that situation) |
Complex Example
The following sequence of operations would create an Analysis GUI EVRIGUI object called "obj", load the data "data", set the analysis method to PCA, set the number of components at 5, calibrate a model, bring up a scores plot, and grab the model object:
obj = evrigui('analysis'); % open a new Analysis GUI and create an attached EVRIGUI object obj.setXblock(data); % load "data" into GUI obj.setMethod('pca'); % set PCA as analysis method obj.setComponents(5); % set 5 PCs as number of components obj.calibrate; % calibrate the model obj.pressButton('plotscores'); % bring up a scores plot model = obj.getModel; % retreive the model as a variable called "model"
Note that text following the % is comment text only. When passing commands like these into Solo, this text can be omitted.