X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FAtom.java;h=5265bc27943b406d29e5f733d9211338625da55b;hb=1148c09dfab7a0c4f3e4d148b8d6c8e64b5686c7;hp=b3a8fdb11955198d4ab41f1216dd0eabe0e13a58;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index b3a8fdb..5265bc2 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -16,56 +16,43 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - package MCview; -import java.util.*; -import java.awt.*; -public class Atom { - double x; - double y; - double z; - int number; - String name; - String resName; - int resNumber; - int type; - Color color; - String chain; +import java.awt.*; - public Atom(StringTokenizer str) { - this.number = (new Integer(str.nextToken())).intValue(); - this.name = str.nextToken(); - this.resName = str.nextToken(); - String tmpstr = new String(); +public class Atom { + float x; + float y; + float z; + int number; + String name; + String resName; + int resNumber; + int type; + Color color = Color.lightGray; + String chain; + int alignmentMapping=-1; - try { - tmpstr = str.nextToken(); + public boolean isSelected = false; - this.resNumber = (new Integer(tmpstr).intValue()); - this.chain = "A"; - this.color = Color.green; + public Atom(String str) + { + name = str.substring(12,15).trim(); - } catch(NumberFormatException e) { - this.chain = tmpstr; + resName = str.substring(17,20); - if (tmpstr.equals("A")) { - this.color = new Color((float)Math.random(),(float)Math.random(),(float)Math.random()); - } else { - this.color = Color.red; - } - this.resNumber = (new Integer(str.nextToken()).intValue()); - } + chain = str.substring(21,22); - this.x = (double)(new Double(str.nextToken()).floatValue()); - this.y = (double)(new Double(str.nextToken()).floatValue()); - this.z = (double)(new Double(str.nextToken()).floatValue()); + resNumber = Integer.parseInt(str.substring(22,26).trim()); - } + this.x = (float) (new Float(str.substring(30,38).trim()).floatValue()); + this.y = (float) (new Float(str.substring(38,46).trim()).floatValue()); + this.z = (float) (new Float(str.substring(47,55).trim()).floatValue()); - public void setColor(Color col) { - this.color = col; - } + } + // public void setColor(Color col) { + // this.color = col; + // } }