X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FAtom.java;h=e38d7aaad1b7a35a9d9c90124b445bcbc476a7c2;hb=f4b7a6009254c29ca4bc4a2b73de173b12b752c7;hp=0aaf0409a13314e72fe59bf9391a25960e8ef538;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index 0aaf040..e38d7aa 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -24,9 +24,9 @@ import java.util.*; public class Atom { - double x; - double y; - double z; + float x; + float y; + float z; int number; String name; String resName; @@ -35,35 +35,37 @@ public class Atom { Color color; String chain; - public Atom(StringTokenizer str) { - this.number = (new Integer(str.nextToken())).intValue(); - this.name = str.nextToken(); + public boolean isSelected = false; + + public Atom(StringTokenizer str) + { + str.nextToken(); // Number, not used in MCview + this.name = str.nextToken(); // Name, not used in MCview + this.resName = str.nextToken(); - String tmpstr = new String(); + String token1 = str.nextToken(); + + String token2 = str.nextToken(); - try { - tmpstr = str.nextToken(); + try{ - this.resNumber = (new Integer(tmpstr).intValue()); - this.chain = "A"; - this.color = Color.green; - } catch (NumberFormatException e) { - this.chain = tmpstr; + this.chain = token1; + resNumber = Integer.parseInt(token2); - if (tmpstr.equals("A")) { - this.color = new Color((float) Math.random(), - (float) Math.random(), (float) Math.random()); - } else { - this.color = Color.red; - } + this.x = (float) (new Float(str.nextToken()).floatValue()); + this.y = (float) (new Float(str.nextToken()).floatValue()); + this.z = (float) (new Float(str.nextToken()).floatValue()); - this.resNumber = (new Integer(str.nextToken()).intValue()); + }catch(NumberFormatException ex) + { + chain = "A"; + resNumber = Integer.parseInt(token1); + this.x = (float) (new Float(token2).floatValue()); + this.y = (float) (new Float(str.nextToken()).floatValue()); + this.z = (float) (new Float(str.nextToken()).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) {