X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FAtom.java;h=f907dff4c06b424ea47cde40f01e0d4b5255cc18;hb=99bd0585b045d25fa719ee007e3310d27e53ac88;hp=0aaf0409a13314e72fe59bf9391a25960e8ef538;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index 0aaf040..f907dff 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -20,53 +20,39 @@ package MCview; import java.awt.*; -import java.util.*; - public class Atom { - double x; - double y; - double z; + float x; + float y; + float z; int number; String name; String resName; int resNumber; int type; - Color color; + Color color = Color.lightGray; String chain; + int alignmentMapping=-1; - public Atom(StringTokenizer str) { - this.number = (new Integer(str.nextToken())).intValue(); - this.name = str.nextToken(); - this.resName = str.nextToken(); + public boolean isSelected = false; - String tmpstr = new String(); + public Atom(String str) + { + name = str.substring(12,15).trim(); - try { - tmpstr = str.nextToken(); + resName = str.substring(17,20); - this.resNumber = (new Integer(tmpstr).intValue()); - this.chain = "A"; - this.color = Color.green; - } catch (NumberFormatException e) { - this.chain = tmpstr; + chain = str.substring(21,22); - if (tmpstr.equals("A")) { - this.color = new Color((float) Math.random(), - (float) Math.random(), (float) Math.random()); - } else { - this.color = Color.red; - } + resNumber = Integer.parseInt(str.substring(22,26).trim()); - this.resNumber = (new Integer(str.nextToken()).intValue()); - } + 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()); - this.x = (double) (new Double(str.nextToken()).floatValue()); - this.y = (double) (new Double(str.nextToken()).floatValue()); - this.z = (double) (new Double(str.nextToken()).floatValue()); } - public void setColor(Color col) { - this.color = col; - } + // public void setColor(Color col) { + // this.color = col; + // } }