Name | Last modified | Size | Description | |
---|---|---|---|---|
Parent Directory | - | |||
defnfact_v1.js-e | 2012-09-29 18:16 | 17K | ||
defnfactory27thSept...> | 2012-09-29 18:16 | 17K | ||
defnfact_v2.js-e | 2012-12-18 15:12 | 17K | ||
Like the Graph Prototype model the Definition Factory model is still at an early stage of development, and uses JS-EDEN in a somewhat experimental way. In its present form, it has limitations, especially where the interface is concerned! It is nonetheless instructive to understand the motivation for the model and to study the code, and and some of the issues involved in its construction. Note that the model may be useful as a web resource even in the construction of traditional EDEN models.
To load the model, you should first load a plugin from the emile library:
include(\"library/greek.js-e\");To load the definition factory, you ideally should then enter:
include(\"models/defnfactory/defnfact_v1.js-e\");into the EDEN Interpreter Window.
For some as yet unknown reason, the layout of the interface is incorrect if the file is included in this manner. You should instead - or if you prefer, in addition! - enter the input by cutting-and-pasting the contents of the file at:
http://jseden.dcs.warwick.ac.uk/emile/models/defnfactory/defnfact_v1.js-e
The use of the definition factory will be illustrated with reference to the extending the graph prototype model by enabling nodes to be moved using the mouse. For the node a, this can be achieved using the following code:
proc mouseMove: mousePressed { if(((mouseX-pax)*(mouseX-pax)<100 )&&((mouseY-pay)*(mouseY-pay)<100)) { if(mousePressed) { pax is mouseX; pay is mouseY; } else { pax = mouseX; pay = mouseY; } } }With patience, the definition factory can be used to generate many instances of this segment of code, so that in principle it is possible to add the moving functionality to all the nodes of the graph constructed using the graph prototype model. Further exploration, comprehension and refinement of the definition factory is left as an (optional) exercise to the interested reader. ");