Class atom

java.lang.Object
  extended byatom
All Implemented Interfaces:
java.lang.Comparable

public class atom
extends java.lang.Object
implements java.lang.Comparable

This class represents an atom, it stores information about its size, color and position relative to a lattice point


Constructor Summary
atom(double x, double y, double z, double mass, java.awt.Color c)
          constructer for an atom object, takes the coords, mass and color of the atom to be created
 
Method Summary
 int compareTo(java.lang.Object o)
          overides the Comparable compareTo method, this compares the passed object with this one and returns -1 if the passed atom is closer in depth than this one, 0 if they are at the same depth and 1 if it is at a lesser depth.
 void drawMe(java.awt.Graphics g2, double screenPos)
          draws the atom at the lattice point specified by screenPos
 void rotate(double angle)
          rotates the atom arround an the (1,1,1) axis fixed at the 0 point
 void setBase(double x, double y, double z)
          sets the position pos of the atom relative to a lattice point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

atom

public atom(double x,
            double y,
            double z,
            double mass,
            java.awt.Color c)
constructer for an atom object, takes the coords, mass and color of the atom to be created

Method Detail

compareTo

public int compareTo(java.lang.Object o)
overides the Comparable compareTo method, this compares the passed object with this one and returns -1 if the passed atom is closer in depth than this one, 0 if they are at the same depth and 1 if it is at a lesser depth.

Specified by:
compareTo in interface java.lang.Comparable

drawMe

public void drawMe(java.awt.Graphics g2,
                   double screenPos)
draws the atom at the lattice point specified by screenPos


setBase

public void setBase(double x,
                    double y,
                    double z)
sets the position pos of the atom relative to a lattice point


rotate

public void rotate(double angle)
rotates the atom arround an the (1,1,1) axis fixed at the 0 point