Please disable Adblockers and enable JavaScript for domain CEWebS.cs.univie.ac.at! We have NO ADS, but they may interfere with some of our course material.

JS Process Editor

As seen in the lower half in a «Demo» instance, there is an area a starting node (alpha). If you right click on this node, it is possible to add other nodes. The editor itself is implement 4 files (you can see them included when you "view source" of the editor html in «Demo») 
 
The editor itself can be included into any arbitrary html file by including 4 javascript statements: 
 
# create new instance of editor
graphrealization = new WfAdaptor(CPEE);
 
# tell it the svg canvas it should use in the document (multiple
# editors with editing disabled can run in parallel, to compare
# documents side by side.).
graphrealization.set_svg_container($('#graphcanvas'));
 
# set the process model to visualize. The editor right now accepts only # cpee internal process models.
# The editor right now operates on purely block structured models.
# Reason: it uses autolayout to produce strictly non-overlapping graphs
# (no lines crossing any other lines).
graphrealization.set_description($(res), true);
 
# Whenever the graph is modified, do something. This code block can be # to attached abitrary web-site
# functionality, such as:
#  * Show a special dialogue/properties for a particular element.
#    (line 3)
#  * Save the changed document to the server with ajax (line 2).
#  * Do whatever you want (line 1)
graphrealization.notify = function(svgid) {
  .... /* line 1 */
  save_description(); /* line 2 */
  manifestation.events.click(svgid,undefined); /* line 3 */
};
Letzte Änderung: 19.06.2012, 16:18 | 246 Worte