JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / jalview / datamodel / SequenceNode.js
1 Clazz.declarePackage ("jalview.datamodel");\r
2 Clazz.load (["jalview.datamodel.BinaryNode", "java.awt.Color"], "jalview.datamodel.SequenceNode", null, function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.dist = 0;\r
5 this.count = 0;\r
6 this.height = 0;\r
7 this.ycount = 0;\r
8 this.color = null;\r
9 this.dummy = false;\r
10 this.placeholder = false;\r
11 Clazz.instantialize (this, arguments);\r
12 }, jalview.datamodel, "SequenceNode", jalview.datamodel.BinaryNode);\r
13 Clazz.prepareFields (c$, function () {\r
14 this.color = java.awt.Color.black;\r
15 });\r
16 Clazz.makeConstructor (c$, \r
17 function (val, parent, dist, name) {\r
18 Clazz.superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);\r
19 this.dist = dist;\r
20 }, "~O,jalview.datamodel.SequenceNode,~N,~S");\r
21 Clazz.makeConstructor (c$, \r
22 function (val, parent, name, dist, bootstrap, dummy) {\r
23 Clazz.superConstructor (this, jalview.datamodel.SequenceNode, [val, parent, name]);\r
24 this.dist = dist;\r
25 this.bootstrap = bootstrap;\r
26 this.dummy = dummy;\r
27 }, "~O,jalview.datamodel.SequenceNode,~S,~N,~N,~B");\r
28 Clazz.defineMethod (c$, "isDummy", \r
29 function () {\r
30 return this.dummy;\r
31 });\r
32 Clazz.defineMethod (c$, "isPlaceholder", \r
33 function () {\r
34 return this.placeholder;\r
35 });\r
36 Clazz.defineMethod (c$, "setDummy", \r
37 function (newstate) {\r
38 var oldstate = this.dummy;\r
39 this.dummy = newstate;\r
40 return oldstate;\r
41 }, "~B");\r
42 Clazz.defineMethod (c$, "setPlaceholder", \r
43 function (Placeholder) {\r
44 this.placeholder = Placeholder;\r
45 }, "~B");\r
46 Clazz.defineMethod (c$, "AscendTree", \r
47 function () {\r
48 var c = this;\r
49 do {\r
50 c = c.parent ();\r
51 } while ((c != null) && c.dummy);\r
52 return c;\r
53 });\r
54 Clazz.defineMethod (c$, "isSequenceLabel", \r
55 function () {\r
56 if (this.name != null && this.name.length > 0) {\r
57 for (var c = 0, s = this.name.length; c < s; c++) {\r
58 var q = this.name.charAt (c);\r
59 if ('0' <= q && q <= '9') continue;\r
60 return true;\r
61 }\r
62 }return false;\r
63 });\r
64 });\r