update author list in license for (JAL-826)
[jalview.git] / src / MCview / Bond.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  * 
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 package MCview;
19
20 import java.awt.*;
21
22 public class Bond
23 {
24   float[] start;
25
26   float[] end;
27
28   Color startCol = Color.lightGray;
29
30   Color endCol = Color.lightGray;
31
32   public Atom at1;
33
34   public Atom at2;
35
36   public Bond(float[] start, float[] end, Atom at1, Atom at2)
37   {
38     this.start = start;
39     this.end = end;
40     this.startCol = at1.color;
41     this.endCol = at2.color;
42     this.at1 = at1;
43     this.at2 = at2;
44   }
45
46   /*
47    * public Bond(Bond bond) { this.start = new float[3];
48    * 
49    * this.start[0] = bond.start[0]; this.start[1] = bond.start[1]; this.start[2]
50    * = bond.start[2];
51    * 
52    * this.end = new float[3];
53    * 
54    * this.end[0] = bond.end[0]; this.end[1] = bond.end[1]; this.end[2] =
55    * bond.end[2];
56    * 
57    * this.startCol = bond.startCol; this.endCol = bond.endCol; }
58    * 
59    * public float length() { float len = ((end[0] - start[0]) * (end[0] -
60    * start[0])) + ((end[1] - start[1]) * (end[1] - start[1])) + ((end[2] -
61    * start[2]) * (end[2] - start[2]));
62    * 
63    * len = (float) (Math.sqrt(len));
64    * 
65    * return len; }
66    */
67
68   public void translate(float x, float y, float z)
69   {
70     start[0] = (start[0] + x);
71     end[0] = (end[0] + x);
72
73     start[1] = (start[1] + y);
74     end[1] = (end[1] + y);
75
76     start[2] = (start[2] + z);
77     end[2] = (end[2] + z);
78   }
79 }