X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FmyAtom.java;h=75dec3713cd58b171bf88530b8ade5609f8817ac;hb=0410fb5d6f4c4e346daf4bb9ad0a78f2e04b4c93;hp=27a4b08459e90dc1044dba0bb6a823ac48c86855;hpb=99c58ee0ae2a848f982552e53feaf6d5cb9925e5;p=jalview.git diff --git a/src/MCview/myAtom.java b/src/MCview/myAtom.java index 27a4b08..75dec37 100755 --- a/src/MCview/myAtom.java +++ b/src/MCview/myAtom.java @@ -16,59 +16,56 @@ * 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 myAtom { - float x; - float y; - float z; - - public int number; - public String name; - public String resName; - public int resNumber; - public int type; - public Color color; - public String chain; - public boolean isSelected = false; +import java.util.*; - public myAtom(StringTokenizer str) { - this.number = (new Integer(str.nextToken())).intValue(); - this.name = str.nextToken(); - this.resName = str.nextToken(); +public class myAtom { + float x; + float y; + float z; + public int number; + public String name; + public String resName; + public int resNumber; + public int type; + public Color color; + public String chain; + public boolean isSelected = false; - String tmpstr = new String(); + public myAtom(StringTokenizer str) { + this.number = (new Integer(str.nextToken())).intValue(); + this.name = str.nextToken(); + this.resName = str.nextToken(); - try { - tmpstr = str.nextToken(); - this.resNumber = (new Integer(tmpstr).intValue()); - this.chain = "A"; - this.color = Color.lightGray; + String tmpstr = new String(); - } catch(NumberFormatException e) { - this.chain = tmpstr; + try { + tmpstr = str.nextToken(); + this.resNumber = (new Integer(tmpstr).intValue()); + this.chain = "A"; + this.color = Color.lightGray; + } catch (NumberFormatException e) { + this.chain = tmpstr; - if (tmpstr.equals("A")) { - this.color = Color.lightGray; + if (tmpstr.equals("A")) { + this.color = Color.lightGray; + } else { + this.color = Color.red; + } - } else { - this.color = Color.red; - } + this.resNumber = (new Integer(str.nextToken()).intValue()); + } - this.resNumber = (new Integer(str.nextToken()).intValue()); + 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.x = (float)(new Float(str.nextToken()).floatValue()); - this.y = (float)(new Float(str.nextToken()).floatValue()); - this.z = (float)(new Float(str.nextToken()).floatValue()); - } - - public void setColor(Color col) { - this.color = col; - } + public void setColor(Color col) { + this.color = col; + } }