Menu

[r42]: / GraphScript / trunk / scripts / algorithmsupport.js  Maximize  Restore  History

Download this file

44 lines (38 with data), 883 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//-------------------------------------------------------------------------------
//Create a new algorithm instance
function createAlgorithm()
{
//return new Packages.ls.graph.script.Algorithm();
return GraphUI.createAlgorithm();
}
function runAlgorithm(alg)
{
if (!alg) return;
alg.run();
}
function addAlgorithmStep(alg,stepFunc,nextStepInd)
{
if (alg)
{
var step = new Packages.ls.graph.script.AlgorithmStep()
{
execute : stepFunc,
getNextStep : function() { return nextStepInd; }
};
//popup(alg+"");
alg.addStep(step);
}
}
var RESET_ALGORITHM_FUNC = function() {};
function setResetFunc(func)
{
if (func && typeof(func) == "function")
RESET_ALGORITHM_FUNC = func;
}
function RESET_ALGORITHM()
{
if (RESET_ALGORITHM_FUNC && typeof(RESET_ALGORITHM_FUNC) == "function")
{
RESET_ALGORITHM_FUNC();
}
}
MongoDB Logo MongoDB