JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / jalview / workers / AlignCalcWorker.js
1 Clazz.declarePackage ("jalview.workers");\r
2 Clazz.load (["jalview.api.AlignCalcWorkerI", "swingjs.JSThread"], "jalview.workers.AlignCalcWorker", null, function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.iFirst = 0;\r
5 this.iLast = 0;\r
6 this.nPer = 2;\r
7 this.started = 0;\r
8 this.alignment = null;\r
9 this.aWidth = 0;\r
10 this.alignViewport = null;\r
11 this.calcMan = null;\r
12 this.ap = null;\r
13 this.ourAnnots = null;\r
14 Clazz.instantialize (this, arguments);\r
15 }, jalview.workers, "AlignCalcWorker", swingjs.JSThread, jalview.api.AlignCalcWorkerI);\r
16 Clazz.makeConstructor (c$, \r
17 function (alignViewport, alignPanel) {\r
18 Clazz.superConstructor (this, jalview.workers.AlignCalcWorker, [null, "AlignCalcWorker"]);\r
19 this.alignViewport = alignViewport;\r
20 this.calcMan = alignViewport.getCalcManager ();\r
21 this.ap = alignPanel;\r
22 }, "jalview.api.AlignViewportI,jalview.api.AlignmentViewPanel");\r
23 Clazz.defineMethod (c$, "abortAndDestroy", \r
24 function () {\r
25 if (this.calcMan != null) {\r
26 this.calcMan.workerComplete (this);\r
27 }this.alignViewport = null;\r
28 this.calcMan = null;\r
29 this.ap = null;\r
30 });\r
31 Clazz.overrideMethod (c$, "involves", \r
32 function (i) {\r
33 return this.ourAnnots != null && this.ourAnnots.contains (i);\r
34 }, "jalview.datamodel.AlignmentAnnotation");\r
35 Clazz.overrideMethod (c$, "removeOurAnnotation", \r
36 function () {\r
37 if (this.ourAnnots != null && this.alignViewport != null) {\r
38 var alignment = this.alignViewport.getAlignment ();\r
39 {\r
40 for (var aa, $aa = this.ourAnnots.iterator (); $aa.hasNext () && ((aa = $aa.next ()) || true);) {\r
41 alignment.deleteAnnotation (aa, true);\r
42 }\r
43 }}});\r
44 Clazz.defineMethod (c$, "notifyDone", \r
45 function () {\r
46 if (this.ap != null) {\r
47 this.ap.paintAlignment (true);\r
48 }this.calcMan.workerComplete (this);\r
49 });\r
50 Clazz.defineStatics (c$,\r
51 "LOOP_STANDBY", 3,\r
52 "LOOP_CALCULATE", 4,\r
53 "MS_MAX", 500);\r
54 });\r