539e3238e5e45157690020e872587e54af5b7981
[jalviewjs.git] / bin / MCview / Bond.js
1 Clazz.declarePackage ("MCview");\r
2 Clazz.load (["java.awt.Color"], "MCview.Bond", null, function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.start = null;\r
5 this.end = null;\r
6 this.startCol = null;\r
7 this.endCol = null;\r
8 this.at1 = null;\r
9 this.at2 = null;\r
10 Clazz.instantialize (this, arguments);\r
11 }, MCview, "Bond");\r
12 Clazz.prepareFields (c$, function () {\r
13 this.startCol = java.awt.Color.lightGray;\r
14 this.endCol = java.awt.Color.lightGray;\r
15 });\r
16 Clazz.makeConstructor (c$, \r
17 function (at1, at2) {\r
18 this.start =  Clazz.newFloatArray (-1, [at1.x, at1.y, at1.z]);\r
19 this.end =  Clazz.newFloatArray (-1, [at2.x, at2.y, at2.z]);\r
20 this.startCol = at1.color;\r
21 this.endCol = at2.color;\r
22 this.at1 = at1;\r
23 this.at2 = at2;\r
24 }, "MCview.Atom,MCview.Atom");\r
25 Clazz.defineMethod (c$, "translate", \r
26 function (x, y, z) {\r
27 this.start[0] = this.start[0] + x;\r
28 this.end[0] = this.end[0] + x;\r
29 this.start[1] = this.start[1] + y;\r
30 this.end[1] = this.end[1] + y;\r
31 this.start[2] = this.start[2] + z;\r
32 this.end[2] = this.end[2] + z;\r
33 }, "~N,~N,~N");\r
34 });\r