New files
[jalview.git] / src / MCview / myAtom.java
1 package MCview;\r
2 \r
3 import java.util.*;\r
4 import java.awt.*;\r
5 \r
6 public class myAtom {\r
7   float x;\r
8   float y;\r
9   float z;\r
10 \r
11   public int     number;\r
12   public String  name;\r
13   public String  resName;\r
14   public int     resNumber;\r
15   public int     type;\r
16   public Color   color;\r
17   public String  chain;\r
18   public boolean isSelected = false;\r
19 \r
20   public myAtom(StringTokenizer str) {\r
21 \r
22     this.number  = (new Integer(str.nextToken())).intValue();\r
23     this.name    = str.nextToken();\r
24     this.resName = str.nextToken();\r
25 \r
26     String tmpstr = new String();\r
27 \r
28     try {\r
29       tmpstr         = str.nextToken();\r
30       this.resNumber = (new Integer(tmpstr).intValue());\r
31       this.chain     = "A";\r
32       this.color     = Color.lightGray;\r
33 \r
34     } catch(NumberFormatException e) {\r
35       this.chain = tmpstr;\r
36 \r
37       if (tmpstr.equals("A")) {\r
38         this.color = Color.lightGray;\r
39 \r
40       } else {\r
41         this.color = Color.red;\r
42       }\r
43 \r
44       this.resNumber = (new Integer(str.nextToken()).intValue());\r
45     }\r
46 \r
47     this.x = (float)(new Float(str.nextToken()).floatValue());\r
48     this.y = (float)(new Float(str.nextToken()).floatValue());\r
49     this.z = (float)(new Float(str.nextToken()).floatValue());\r
50   }\r
51 \r
52   public void setColor(Color col) {\r
53     this.color = col;\r
54   }\r
55 }\r