-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface_handler.js
27 lines (23 loc) · 961 Bytes
/
interface_handler.js
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
function start(id) {
var val = document.getElementById("txt_vertex").value;
if (!isNumber(val))
val = 10;
if (val < 4)
val = 4;
val = Math.floor(val);
document.getElementById("txt_vertex").value = val;
/*document.getElementById("lb_unexpl").innerHTML = "Unexplored:";
document.getElementById("lb_expl").innerHTML = "Exploring:";
document.getElementById("lb_onhull").innerHTML = "OnHull:";
document.getElementById("lb_inhull").innerHTML = "InsideHull:";*/
var verList = Processing.getInstanceById(id).startAppl(val);
var secListArr = verList.split(";");
document.getElementById("lb_unexpl").innerHTML = secListArr[0];
document.getElementById("lb_expl").innerHTML = secListArr[1];
document.getElementById("lb_onhull").innerHTML = secListArr[2];
document.getElementById("lb_inhull").innerHTML = secListArr[3];
Processing.getInstanceById(id).focus();
}
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}