org.jscience.chemistry.gui.extended.molecule
Class Atom

java.lang.Object
  extended by org.jscience.chemistry.gui.extended.molecule.Atom
All Implemented Interfaces:
PropAttributesInter

public class Atom
extends java.lang.Object
implements PropAttributesInter

Tripos base Atom class


Field Summary
static java.util.Hashtable atomColor
          Atom color map
protected  int charge
          Atomic charge
protected  java.awt.Color color
          Current atom color
static java.awt.Color colorDefault
          Default color
protected  boolean display
          Flag indicating if atom label should be displayed
protected  boolean highlight
          Flag indicating if atom is highlighted
protected  int id
          Atom id
protected  java.lang.String name
          Elemental name
 PropAttributes prop
          Property list at the end of the atom string
protected  boolean select
          Flag indicating if atom is selcted
protected  float tx
          Transformed atom coordinates
protected  float ty
          Transformed atom coordinates
protected  java.lang.String type
          SYBYL force field atom type
protected  float tz
          Transformed atom coordinates
protected  float x
          Atom coordinates
protected  float y
          Atom coordinates
protected  float z
          Atom coordinates
 
Constructor Summary
Atom()
          Default constructor
Atom(Atom a)
          Copy constructor
Atom(float x, float y, float z)
          Real coordinates constructor
Atom(float x, float y, float z, float tx, float ty, float tz)
          Real and transformed coordinates constructor
Atom(int id, java.lang.String name, float x, float y, float z, float tx, float ty, float tz, int charge)
          constructor, no prop
Atom(int id, java.lang.String name, float x, float y, float z, float tx, float ty, float tz, int charge, java.util.Properties prop)
          Full constructor
 
Method Summary
 boolean equals(Atom a)
          Compares this atom with another
 java.util.Properties getAttributes()
          Return the property containing attributes
 int getCharge()
          Returns the atomic charge
 java.awt.Color getColor()
          Returns the color with which the atom is to be drawn when displayed
 java.awt.Color getColorFromType()
          Returns color according to the atom type
 int getId()
          Returns id of the atom
 java.lang.String getName()
          Returns the elemental name
 PropAttributes getPropAttributes()
          Get the encapsluation of the properties object which holds the attributes
 float getTx()
          Returns the transformed x coordinate of the atom
 float getTy()
          Returns the transformed y coordinate of the atom
 java.lang.String getType()
          Returns SYBYL force field atom type
 float getTz()
          Returns the transformed z coordinate of the atom
 float getX()
          Returns the x coordinate of the atom
 float getY()
          Returns the y coordinate of the atom
 float getZ()
          Returns the z coordinate of the atom
 boolean isCarbon()
          Return true if the atom is a carbon atom
 boolean isHighlighted()
          Returns true if the atom is highlighted by user
 boolean isHydrogen()
          Return true if the atom is a hydrogen atom
 boolean isSelected()
          Returns true if the atom is selected by user
 boolean needDisplay()
          Return true if the atom need to be display
 void setAttributes(java.util.Properties p)
          Set the attributes for the atom
 void setCharge(int c)
          Set the atomic charge
 void setColor(java.awt.Color color)
          Set the color with which the atom is drawn
 void setDisplay(boolean displayOrNot)
          Set the state to indicate whether the atom is to be formally displayed
 void setHighlight(boolean highlightOrNot)
          Set the state to indicate whether the atom is hightlighted
 void setId(int id)
          Set the atom id
 void setName(java.lang.String s)
          Set the name
 void setPropAttributes(PropAttributes p)
          Set the attributes for the atom
 void setSelect(boolean selectOrNot)
          Set the state to indicate whether the atom is selected
 void setTx(float tx)
          Set the transformed x coordinate of the atom
 void setTy(float ty)
          Set the transformed y coordinate of the atom
 void setType(java.lang.String s)
          Set the SYBYL force field type
 void setTz(float tz)
          Set the transformed z coordinate of the atom
 void setX(float x)
          Set the x coordinate of the atom
 void setY(float y)
          Set the y coordinate of the atom
 void setZ(float z)
          Set the z coordinate of the atom
 java.lang.String toString()
          Returns String representation of Atom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

atomColor

public static java.util.Hashtable atomColor
Atom color map


colorDefault

public static final java.awt.Color colorDefault
Default color


id

protected int id
Atom id


name

protected java.lang.String name
Elemental name


type

protected java.lang.String type
SYBYL force field atom type


x

protected float x
Atom coordinates


y

protected float y
Atom coordinates


z

protected float z
Atom coordinates


tx

protected float tx
Transformed atom coordinates


ty

protected float ty
Transformed atom coordinates


tz

protected float tz
Transformed atom coordinates


charge

protected int charge
Atomic charge


select

protected boolean select
Flag indicating if atom is selcted


highlight

protected boolean highlight
Flag indicating if atom is highlighted


display

protected boolean display
Flag indicating if atom label should be displayed


prop

public PropAttributes prop
Property list at the end of the atom string


color

protected java.awt.Color color
Current atom color

Constructor Detail

Atom

public Atom(int id,
            java.lang.String name,
            float x,
            float y,
            float z,
            float tx,
            float ty,
            float tz,
            int charge,
            java.util.Properties prop)
Full constructor

Parameters:
id - atom id
name - elemental name of atom
x - x coordinate of atom
y - y coordinate of atom
z - z coordinate of atom
tx - tx transformed coordinate of atom
ty - ty transformed coordinate of atom
tz - tz transformed coordinate of atom
charge - atom charge
prop - atom attributes strings

Atom

public Atom(int id,
            java.lang.String name,
            float x,
            float y,
            float z,
            float tx,
            float ty,
            float tz,
            int charge)
constructor, no prop

Parameters:
id - atom id
name - elemental name of atom
x - x coordinate of atom
y - y coordinate of atom
z - z coordinate of atom
tx - tx transformed coordinate of atom
ty - ty transformed coordinate of atom
tz - tz transformed coordinate of atom
charge - atom charge

Atom

public Atom()
Default constructor


Atom

public Atom(float x,
            float y,
            float z)
Real coordinates constructor

Parameters:
x - x coordinate of atom
y - y coordinate of atom
z - z coordinate of atom

Atom

public Atom(float x,
            float y,
            float z,
            float tx,
            float ty,
            float tz)
Real and transformed coordinates constructor

Parameters:
x - x coordinate of atom
y - y coordinate of atom
z - z coordinate of atom
tx - tx transformed coordinate of atom
ty - ty transformed coordinate of atom
tz - tz transformed coordinate of atom

Atom

public Atom(Atom a)
Copy constructor

Parameters:
a - atom to be copied
Method Detail

setName

public void setName(java.lang.String s)
Set the name

Parameters:
s - elemental name of atom
See Also:
getName()

setType

public void setType(java.lang.String s)
Set the SYBYL force field type

See Also:
getType()

setCharge

public void setCharge(int c)
Set the atomic charge

Parameters:
c - charge
See Also:
getCharge()

getName

public java.lang.String getName()
Returns the elemental name

See Also:
setName(java.lang.String)

getType

public java.lang.String getType()
Returns SYBYL force field atom type

See Also:
setType(java.lang.String)

getCharge

public int getCharge()
Returns the atomic charge

See Also:
setCharge(int)

equals

public boolean equals(Atom a)
Compares this atom with another

Parameters:
a - atom to compare with
Returns:
true if atoms are equal, else false

toString

public java.lang.String toString()
Returns String representation of Atom

Overrides:
toString in class java.lang.Object

getAttributes

public java.util.Properties getAttributes()
Return the property containing attributes

Specified by:
getAttributes in interface PropAttributesInter
Returns:
DOCUMENT ME!

getPropAttributes

public PropAttributes getPropAttributes()
Get the encapsluation of the properties object which holds the attributes

Specified by:
getPropAttributes in interface PropAttributesInter
Returns:
DOCUMENT ME!

setAttributes

public void setAttributes(java.util.Properties p)
Set the attributes for the atom

Specified by:
setAttributes in interface PropAttributesInter
Parameters:
p - Property for the atom

setPropAttributes

public void setPropAttributes(PropAttributes p)
Set the attributes for the atom

Specified by:
setPropAttributes in interface PropAttributesInter
Parameters:
p - Property for the atom

getId

public int getId()
Returns id of the atom


getX

public float getX()
Returns the x coordinate of the atom


getY

public float getY()
Returns the y coordinate of the atom


getZ

public float getZ()
Returns the z coordinate of the atom


getTx

public float getTx()
Returns the transformed x coordinate of the atom


getTy

public float getTy()
Returns the transformed y coordinate of the atom


getTz

public float getTz()
Returns the transformed z coordinate of the atom


getColor

public java.awt.Color getColor()
Returns the color with which the atom is to be drawn when displayed


getColorFromType

public java.awt.Color getColorFromType()
Returns color according to the atom type


isSelected

public boolean isSelected()
Returns true if the atom is selected by user


isHighlighted

public boolean isHighlighted()
Returns true if the atom is highlighted by user


needDisplay

public boolean needDisplay()
Return true if the atom need to be display


isCarbon

public boolean isCarbon()
Return true if the atom is a carbon atom


isHydrogen

public boolean isHydrogen()
Return true if the atom is a hydrogen atom


setId

public void setId(int id)
Set the atom id

Parameters:
id - id
See Also:
getId()

setX

public void setX(float x)
Set the x coordinate of the atom

Parameters:
x - X-coordinate of the atom
See Also:
getX()

setY

public void setY(float y)
Set the y coordinate of the atom

Parameters:
y - Y-coordinate of the atom
See Also:
getY()

setZ

public void setZ(float z)
Set the z coordinate of the atom

Parameters:
z - Z-coordinate of the atom
See Also:
getZ()

setTx

public void setTx(float tx)
Set the transformed x coordinate of the atom

Parameters:
tx - transformed X-coordinate of the atom
See Also:
getTx()

setTy

public void setTy(float ty)
Set the transformed y coordinate of the atom

Parameters:
ty - transformed Y-coordinate of the atom
See Also:
getTy()

setTz

public void setTz(float tz)
Set the transformed z coordinate of the atom

Parameters:
tz - transformed Z-coordinate of the atom
See Also:
getTz()

setSelect

public void setSelect(boolean selectOrNot)
Set the state to indicate whether the atom is selected

Parameters:
selectOrNot - select state of the atom
See Also:
isSelected()

setHighlight

public void setHighlight(boolean highlightOrNot)
Set the state to indicate whether the atom is hightlighted

Parameters:
highlightOrNot - highlight state of the atom
See Also:
isHighlighted()

setDisplay

public void setDisplay(boolean displayOrNot)
Set the state to indicate whether the atom is to be formally displayed

Parameters:
displayOrNot - highlight state of the atom
See Also:
needDisplay()

setColor

public void setColor(java.awt.Color color)
Set the color with which the atom is drawn

Parameters:
color - color for the atom
See Also:
getColor()