The Script
Editor
We saw that in the template
editor it is possible to select a
script as executable code.
Matrex also gives you the possibility to write the
script,
even if
the capabilities of the Matrex script editor are very limited.
This is because I did not find a good Jython editor to
integrate
in Matrex, and it was out of the purpose of this project to build
one. Besides, there are a few Jython editors available (one of them
is
a plug-in of Eclipse), so you can use one of them instead of the
Matrex one if you like.
To create a new script select the application menu Scripts
-> New Script -> jython (more scripting
languages are available as plug-ins).
The following window appears:
It is
a simple multi
line text box that shows a skeleton of a
python Matrex function, which can be edited and saved.
The idea is to:
- write in form of
a script a class
inheriting from IFunction (as you do in java), which calculates a
function using matrices
- save it
- use
it as the code for the new template
that calculates that function, in the template
editor.
To know how to write
Jython code, go to the site
www.jython.org.
To know how to write a Matrex function, read the document
“Matrex
Function Coding”.
The menu Script->Help
opens a
browser (IE, Mozilla or
Firefox) which shows the page in the Internet that contains help for
the selected scripting language (here Jython).
To close the Script 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 script
(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 script and close the editor: a
“Save Dialog” appears; select the name of the file
you want to save and the directory where you want to save it, and press
OK.