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
5 * This file is part of Jalview.
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.
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.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
34 public String resName;
38 public char insCode = ' ';
40 public String resNumIns = null;
44 Color color = Color.lightGray;
49 * this is a temporary value - designed to store the position in sequence that this atom corresponds to after aligning the chain to a SequenceI object. Do not rely on its value being correct when visualizing sequence colourings on the structure - use the StructureSelectionManager's mapping instead.
51 public int alignmentMapping = -1;
55 public float occupancy = 0;
57 public float tfactor = 0;
58 // need these if we ever want to export Atom data
59 // public boolean tfacset=true,occset=true;
60 public boolean isSelected = false;
62 public Atom(String str)
64 atomIndex = Integer.parseInt(str.substring(6, 11).trim());
66 name = str.substring(12, 15).trim();
68 resName = str.substring(17, 20);
70 chain = str.substring(21, 22);
72 resNumber = Integer.parseInt(str.substring(22, 26).trim());
73 resNumIns = str.substring(22, 27);
74 insCode = str.substring(26, 27).charAt(0);
75 this.x = (float) (new Float(str.substring(30, 38).trim()).floatValue());
76 this.y = (float) (new Float(str.substring(38, 46).trim()).floatValue());
77 this.z = (float) (new Float(str.substring(47, 55).trim()).floatValue());
78 // optional entries - see JAL-730
79 String tm = str.substring(54, 60).trim();
81 occupancy = (float) (new Float(tm)).floatValue();
83 occupancy = 1f; // default occupancy
84 // see note above: occset=false;
86 tm = str.substring(60, 66).trim();
89 tfactor = (float) (new Float(tm).floatValue());
92 //see note above: tfacset=false;
96 public Atom(float x, float y, float z)
102 // public void setColor(Color col) {