The
Template Editor
The
template editor is composed by three tab
folders: Template Data, Template Parameters, Template Matrices
Definitions.
Let's give a look to each of them.
Template
Data
This folder is used
to enter the template main information and the parameters definitions.
Let's look at the fields in detail:
- Class/Script:
the Java class or the script
that Matrex calls when the function has to be recalculated. You choose
if you want a class or script with the options
“Class” / “Script”. If you
decided
to set as executable code a Java class, you need to press the Class
button, which opens the class
choice dialog, where you can select the class you want to use
as template code.
If
instead you decided to set as executable code a script, you need to
select the kind of script (Jython is the only available choice in
version 1.0) in the combo box and then press the Script
button. This opens a Open
File dialog, in which
you can select the file containing the script to associate to the
template.
- Input
matrices min/max:
the minimum and the maximum amount of input matrices (consecutive, from
the first one) that needs to be filled when a function is built from
this template; the optional matrices are always at the end (from the
minimum to the maximum amount).
- Output
matrices min/max:
the minimum and
the maximum amount of output (result) matrices (consecutive, from the
first one) that needs to be filled when a function is built from this
template; the optional matrices are always at the end.
- Template
description: a
description that is showed under the template tree,
in the template
selection dialog and as the Info
field in the function
editor when a function is built from this
template.
Template Parameters
To
add a new parameter
definition, press the Add button on the bottom of
the list, that opens the parameter
description dialog.
To
remove the selected parameter definition from the parameters
definitions list use the button Remove.
Update opens the the parameter
description dialog with which you can update the parameter definition.
Pressing the button Up or Down moves the selected parameter
definition up and down in the list
Template
Matrices Definitions
This folder is used to enter the input and output
matrices definitions of this template.
You don't
decide here which matrices
are mandatory or which are optionals.
This is decided in the Template
data
tab folder, in the Input matrices min/max and Output
matrices min/max fields.
If the number of matrix
definitions
entered in a list is less than the related max field value, when you
build a function based on this template the last matrix definition in
the list is replicated to fill up the list of
requested matrices to the end. Which means that if you for example have
4 matrices but the max value is 6, the last two lines will contain the 4th
matrix definition.
The tab folder
is is
divided in two panels, Input for the input matrices
definitions, Output for the output matrices
definitions. These two
panels work approximately in the same way. You add, remove or update lines of the
lists, which are equivalent to matrix definitions.
More in detail, in the input matrices definition dialog:
- With the Add
button you add new matrices definitions to the template
using the input matrix info dialog.
- The
Remove
button removes the
selected matrix definitions from the list, after you confirm it.
- Pressing the Update
button you update the selected matrix definition, with the input matrix info dialog.
- The Up
button switches
the
selected matrix definition with the previous one in the list.
- The Down
button switches the selected matrix definition with the next one in the
list
In the output matrices definition dialog:
- With the Add
button you add new matrices definitions to the template
using the output matrix info dialog.
- The
Remove
button removes the
selected matrix definitions from the list, after you confirm it.
- Pressing the Update
button you update the selected matrix definition, with the output matrix info dialog.
- The Up
button switches
the
selected matrix definition with the previous one in the list.
- The Down
button switches the selected matrix definition with the next one in the
list
To
close the Template editor, you can:
- click on
the Cancel button on the bottom of the editor. In
this way you close the editor without saving the content of the
template (you need to confirm this choice).
- click
on the Save button on the
bottom of the editor. In this way you save the content of the template
and close the editor. To do that, you need to write the name and the
package of the new template in the name-package
dialog.