Deprecated: Return type of ResultWrapper::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 174

Deprecated: Return type of ResultWrapper::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 192

Deprecated: Return type of ResultWrapper::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 185

Deprecated: Return type of ResultWrapper::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 202

Deprecated: Return type of ResultWrapper::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/db/DatabaseUtility.php on line 163

Warning: Trying to access array offset on value of type bool in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/libs/IPSet.php on line 243

Warning: Trying to access array offset on value of type bool in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/libs/IPSet.php on line 246

Warning: Trying to access array offset on value of type bool in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/libs/IPSet.php on line 243

Warning: Trying to access array offset on value of type bool in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/libs/IPSet.php on line 246

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php on line 2104

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 104

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 104

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 105

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 105

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 106

Warning: Trying to access array offset on value of type null in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/profiler/SectionProfiler.php on line 106

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/skins/SkinTemplate.php on line 313
Difference between revisions of "Coding explore methods" - Rave Documentation

Difference between revisions of "Coding explore methods"

From Rave Documentation
Jump to: navigation, search
(Required Files)
(How does Rave know which explore methods a workspace object is using?)
Line 55: Line 55:
  
 
Similarly, you must take care to remove the method's keyword from udata.explorel.method when the method is turned off. (Use the setdiff function for this.)
 
Similarly, you must take care to remove the method's keyword from udata.explorel.method when the method is turned off. (Use the setdiff function for this.)
 +
 +
Rave uses this information to determine which "update" functions to run in response to events. If you do not append the explore method keyword to this list, Rave will not run your update functions.

Revision as of 16:40, 7 May 2014

Introduction

An "explore method" is a customization that can be applied to a workspace object to specialize it in some way. Yes, that is a vague definition. More importantly, explore methods provide a way for you to add a custom tab to a workspace object, which you can use to do pretty much anything.

Explore methods are the things that you access from the Specialize tab. I call them explore methods because the Specialize tab used to be called the "Explore tab," and all the references in the code still use "explore". (Including that the tab itself is created in exploretab.m)

Explore methods live in the rave\exploremethods\ folder. Just like everything other rave plugin, each explore method goes in its own folder, whose name serves as the KEYWORD. All the files related to the explore method will also contain this KEYWORD, which is how Rave knows which files to use for which purposes.

In order for an explore method to be useable on a particular workspace object, one of the following conditions must be true:

  • The explore method keyword is listed in the workspace object's graphproperties file under properties.exploremethods
  • The workspace object key word is listed in the explore method's exploreproperties file under properties.workspaceobjects

This way, if you code a new workspace object you can let it access exising explore methods without having to change the explore methods' code, and if you code a new explore method you can let it access existing workspace objects without changing the workspace objects' code.

Required Files

Each explore method requires 2 files, but will probably also have several "update" files that run in response to certain user actions and maybe other functions used by your uicontrol callbacks.

Required files:

  • exploreproperties<KEWORD> - this is similar to the graphproperties file used by workspace objects, although it contains fewer properties. Note that the properties stored in this file should all be static. You should not add your own properties to this file... those things should be stored in the workspace object's udata.explore field as described below. This file must contain the following properties:
    • properties.longname = the string that appears in the menu on the Specialize tab. This is the name of this method that the user will see.
    • properties.updates = a cell array of strings that lists the events and updates that trigger an update for this explore method. This list should contain all events that require an update for ANY workspace object, i.e. if the event causes some workspace objects to require an update, but others to not require an update, the event SHOULD appear in this list.
  • makeuicontrols<KEYWORD> - this file creates the uicontrols on the Specialize tab that appear when the user selects this explore method from the menu on the Specialize tab. You can also store the callbacks for these uicontrols in this file, or you can put them in their own files. The output of this function is a row vector (must be a row) of handles of all objects that were created. (Rave will append this to handles.tabobjects for you; you shouldn't do that in this function). For most explore methods, this function should create a button that toggles the method on and off (although this doesn't make sense for all methods and is by no means required).

Everything else is optional, but you will probably have one or more "update" files with filenames using this naming convention:

raveupdateexplore<EXPLORE METHOD KEYWORD><UPDATE TYPE>

Rave will automatically run such files in response to the event specified by "update type".

You may also have other files containing functions that are used by this explore method, for example callbacks for the uicontrols created by the makeuicontrols function. Rave DOES NOT automatically run these functions, they would only run in response to being called as a uicontrol callback you define, or called from one of your other functions. For example, many explore methods have an "Enable" button created in their makeuicontrols function, and they have a function named "raveenable<KEYWORD>". Rave does not recognize this function name as being meaningful... it could be called anything. It is only referenced in the code for makeuincontrols as the callback function of the Enable button.



Overloading Explore Methods for Particular Workspace Objects

You can also "overload" any of the three file types described above for a particular workspace object by including a file named:

  • exploreproperties<EXPLORE METHOD KEYWORD><WORKSPACE OBJECT KEYWORD>
  • makeuicontrols<EXPLORE METHOD KEYWORD><WORKSPACE OBJECT KEYWORD>
  • raveupdateexplore<EXPLORE METHOD KEYWORD><WORKSPACE OBJECT KEYWORD><UPDATE TYPE>

If you include any or all of these files, they will be used when you are working with the specified workspace object. You can use this syntax as an alternative to creating an entirely new explore method for a particular workspace object(s). This option may be preferable when the customization required for a particular workspace object is fairly minor.

For example, if your explore method's keyword is "zoomzoom" and it updates in response to the user changing the selection, and you need a special update behavior for histograms, you would include a function named:

  • raveupdateexplorezoomzoomhistogramisselected.m

Rave will run this function when you have a histogram that is using the zoomzoom explore method and the user changes the selected data for the dataset/analysis used by the histogram.

One potential issue is that these filenames can get very long. For example, raveupdateexplorezoomzoomhistogramisselected is 44 characters. The maximum allowable function name in matlab is 64 characters, so try not to use excessively long keywords.

How does Rave know which explore methods a workspace object is using?

It doesn't know unless you tell it.

You indicate that an explore method is "active" by appending its keyword to the field udata.explore.method, which is a cell array of strings. You should do this somewhere in one of the callbacks/functions for the explore method that serves as an activation function. Rave uses this list to determine when to run the update functions.

Similarly, you must take care to remove the method's keyword from udata.explorel.method when the method is turned off. (Use the setdiff function for this.)

Rave uses this information to determine which "update" functions to run in response to events. If you do not append the explore method keyword to this list, Rave will not run your update functions.


Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Deprecated: header(): Passing null to parameter #3 ($response_code) of type int is deprecated in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/rave.gatech.edu/httpdocs/help/languages/Language.php:2104) in /var/www/vhosts/rave.gatech.edu/httpdocs/help/includes/WebResponse.php on line 37