|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.chemistry.gui.extended.molecule.Molecule
public class Molecule
Tripos base molecule class
AtomVector,
BondVector,
Atom,
Bond,
Matrix3D| Field Summary | |
|---|---|
protected java.util.Hashtable |
atomIdToIndex
Atom id to index map. |
protected AtomVector |
highlightAtoms
List of highlighted atom |
protected int |
id
Molecule id |
protected Matrix3D |
mat
The transformation matrix |
protected AtomVector |
myAtoms
Atom list |
protected BondVector |
myBonds
Bond list |
protected RingVector |
myRings
Ring list |
protected java.lang.String |
name
Molecule name |
protected int |
numAtoms
Number of atoms |
protected int |
numBonds
Number of bonds |
protected int |
numRings
Number of rings |
protected java.util.Hashtable |
properties
Properties list |
protected static Renderer |
rendererDefault
Default renderer so that pre-existing programs can still call Molecule.draw( Graphics ) |
protected AtomVector |
selectAtoms
List of selected atoms |
protected float |
xmax
The bounding extents of the molecule |
protected float |
xmin
The bounding extents of the molecule |
protected float |
ymax
The bounding extents of the molecule |
protected float |
ymin
The bounding extents of the molecule |
protected float |
zmax
The bounding extents of the molecule |
protected float |
zmin
The bounding extents of the molecule |
| Constructor Summary | |
|---|---|
Molecule()
Default constructor |
|
Molecule(int id,
java.lang.String name)
Id/Name constructor |
|
Molecule(Molecule jmol)
Copy constructor |
|
| Method Summary | |
|---|---|
void |
addAtom(Atom a)
Add an atom to this molecule |
void |
addBond(Bond b)
Add a bond to this molecule |
void |
addMolecule(Molecule jmol)
Add a molecule to this molecule |
void |
addProperty(java.lang.String name,
java.lang.String value)
Add a property (i.e. a "name"/"value" pair) to this molecule. |
void |
addRing(Ring r)
Add a ring to this molecule |
void |
calcPerpUnitVec(float x1,
float y1,
float x2,
float y2,
float[] pex,
float[] pey)
Calculates 2D vector perpendicular to bond |
boolean |
contains(Atom a)
Return true iff the atom in the parameter is one of the atoms in this molecule |
boolean |
contains(Bond b)
Return true iff the bond in the parameter is one of the bonds in this molecule |
void |
dehighlight()
Dehighlighted all highlighted atoms. |
void |
deleteAtom(Atom a)
Delete an atom and its bonds from this molecule |
void |
deleteBond(Bond b)
Delete a bond from this molecule |
void |
deleteProperty(java.lang.String name)
Remove a property from this molecule. |
void |
deleteRing(Ring r)
Delete a ring from this molecule |
void |
deselect()
Deselects all selected atoms |
void |
deselect(Atom a)
Deselect one selected atom |
void |
draw(java.awt.Graphics g)
Draw the molecule recommend to avoid, but to use renderer approach |
boolean |
equals(Molecule jmol)
Compares this molecule with another |
Atom |
findAtom(float x,
float y,
float z,
float FINDRADIUS)
Returns closest atom to point within FINDRADIUS, null if nothing is found, |
void |
findBB()
Determines bounding box of a molecule (sets xmax,xmin,ymax,ymin,zmax,zmin) |
Atom |
getAtomFromId(int atomId)
Return an atom in this molecule whose id matches the input id |
java.util.Hashtable |
getAtomIdToIndex()
Return atomIdToIndex |
Bond |
getBondFromId(int bondId)
Return a bond in this molecule whose id matches the input id |
AtomVector |
getHighlightAtoms()
Return the highlighted atoms vector |
int |
getId()
Returns id of this molecule |
Matrix3D |
getMatrix3D()
Return 3D transformation matrix |
AtomVector |
getMyAtoms()
Returns atom vector of this molecule |
BondVector |
getMyBonds()
Return bond vector of this molecule |
RingVector |
getMyRings()
Return ring vector of this molecule |
java.lang.String |
getName()
Returns name of molecule |
int |
getNumAtoms()
Return number of atoms in this molecule |
int |
getNumBonds()
Return number of bonds in this molecule |
int |
getNumRings()
Return number of rings in this molecule |
java.util.Hashtable |
getProperties()
Return property table in this molecule |
java.lang.String |
getPropertyValue(java.lang.String name)
Get the property value associated with specified property name. |
protected static Renderer |
getRenderer()
Return the Renderer which draws this molecule |
AtomVector |
getSelectAtoms()
Return the selected atoms vector |
float |
getXmax()
Return the maxmum x coordinate |
float |
getXmin()
Return the minimum x coordinate of this molelcule |
float |
getYmax()
Return the maxmum y coordinate |
float |
getYmin()
Return the minimum y coordinate |
float |
getZmax()
Return the maxmum z coordinate |
float |
getZmin()
Return the minimum z coordinate |
protected boolean |
hasHighlightedAtoms()
Returns true if molecule has highlighted atoms |
boolean |
hasSelectedAtoms()
Returns true if molecule has selected atoms |
void |
highlight(Atom a)
Designates an atom as highlighted. |
void |
highlight(AtomVector av)
Designates an atom list as highlighted. |
boolean |
isAProperty(java.lang.String name)
Indicate if the molecule contains the specified property. |
boolean |
isOuterBond(Bond b,
float tx1,
float ty1,
float tx2,
float ty2)
Returns true if bond is oriented counterclockwise with respect to the centroid of the ring, else returns false. |
void |
select(Atom a)
Flags specified atom as selected |
void |
setAtomIdToIndex(java.util.Hashtable index)
Set atomIdToIndex |
void |
setHighlightAtoms(AtomVector av)
Set highlighted atoms vector |
void |
setId(int id)
Set id of this molecule |
void |
setMatrix3D(Matrix3D mat)
Set 3D transformation matrix |
void |
setMyAtoms(AtomVector atoms)
Set atom vector |
void |
setMyBonds(BondVector bv)
Set bond vector |
void |
setMyRings(RingVector rv)
Set ring vector |
void |
setName(java.lang.String s)
Set name of this molecule |
void |
setNumAtoms(int numAtoms)
Set number of atoms |
void |
setNumRings(int numRings)
Set number of rings |
void |
setProperties(java.util.Hashtable prop)
Set property table |
protected static void |
setRenderer(Renderer r)
Set renderer which draws this molecule |
void |
setSelectAtoms(AtomVector av)
Set selected atoms vector |
void |
setXmax(float xmax)
Set maxmum of X-coordinate |
void |
setXmin(float xmin)
Set minimum of X-coordinate of this molecule |
void |
setYmax(float ymax)
Set maxmum of Y-coordinate |
void |
setYmin(float ymin)
Set minimum of Y-coordinate |
void |
setZmax(float zmax)
Set maxmum of Z-coordinate |
void |
setZmin(float zmin)
Set minimum of Z-coordinate |
java.lang.String |
toString()
Returns a String representation of molecule |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static Renderer rendererDefault
protected int id
protected java.lang.String name
protected AtomVector myAtoms
protected java.util.Hashtable atomIdToIndex
protected BondVector myBonds
protected RingVector myRings
protected int numAtoms
protected int numBonds
protected int numRings
protected java.util.Hashtable properties
protected Matrix3D mat
protected float xmin
protected float ymin
protected float zmin
protected float xmax
protected float ymax
protected float zmax
protected AtomVector selectAtoms
protected AtomVector highlightAtoms
| Constructor Detail |
|---|
public Molecule(int id,
java.lang.String name)
id - molecule idname - molecule namepublic Molecule()
public Molecule(Molecule jmol)
jmol - molecule to be copied| Method Detail |
|---|
public void addAtom(Atom a)
a - atom to be addeddeleteAtom(org.jscience.chemistry.gui.extended.molecule.Atom)public void addBond(Bond b)
b - bond to be addeddeleteBond(org.jscience.chemistry.gui.extended.molecule.Bond)public void addRing(Ring r)
r - ring to be addeddeleteRing(org.jscience.chemistry.gui.extended.molecule.Ring)public void addMolecule(Molecule jmol)
jmol - molecule to be addedpublic void deleteAtom(Atom a)
a - atom to be deleteddeleteBond(org.jscience.chemistry.gui.extended.molecule.Bond),
addAtom(org.jscience.chemistry.gui.extended.molecule.Atom)public void deleteBond(Bond b)
b - bond to be deletedaddBond(org.jscience.chemistry.gui.extended.molecule.Bond)public void deleteRing(Ring r)
r - ring to be deletedaddRing(org.jscience.chemistry.gui.extended.molecule.Ring)
public void addProperty(java.lang.String name,
java.lang.String value)
name - name of property to be addedvalue - value associated with "name"public void deleteProperty(java.lang.String name)
name - name of property to be removedpublic java.lang.String getPropertyValue(java.lang.String name)
name - name of property whose value is soughtpublic boolean isAProperty(java.lang.String name)
name - name of property to check forpublic void select(Atom a)
a - atom to be selectedpublic void deselect()
select(org.jscience.chemistry.gui.extended.molecule.Atom)public void deselect(Atom a)
select(org.jscience.chemistry.gui.extended.molecule.Atom),
deselect()public boolean hasSelectedAtoms()
select(org.jscience.chemistry.gui.extended.molecule.Atom)protected boolean hasHighlightedAtoms()
highlight(org.jscience.chemistry.gui.extended.molecule.Atom)public void setName(java.lang.String s)
s - name of moleculegetName()public java.lang.String getName()
setName(java.lang.String)public void findBB()
public boolean equals(Molecule jmol)
jmol - molecule to compare with
public void highlight(Atom a)
a - atom to highlightpublic void highlight(AtomVector av)
av - list (vector) of atoms to highlightpublic void dehighlight()
public boolean isOuterBond(Bond b,
float tx1,
float ty1,
float tx2,
float ty2)
b - potential ring bond to be checkedtx1 - transformed x coordinate of bond's from atomty1 - transformed y coordinate of bond's from atomtx2 - transformed x coordinate of bond's to atomty2 - transformed y coordinate of bond's to atom
public void calcPerpUnitVec(float x1,
float y1,
float x2,
float y2,
float[] pex,
float[] pey)
public Atom findAtom(float x,
float y,
float z,
float FINDRADIUS)
#FINDRADIUSpublic void draw(java.awt.Graphics g)
g - Graphicspublic java.lang.String toString()
toString in class java.lang.Objectpublic int getId()
public AtomVector getMyAtoms()
public java.util.Hashtable getAtomIdToIndex()
public BondVector getMyBonds()
public RingVector getMyRings()
public int getNumAtoms()
public int getNumBonds()
public int getNumRings()
public java.util.Hashtable getProperties()
public Matrix3D getMatrix3D()
public float getXmin()
public float getYmin()
public float getZmin()
public float getXmax()
public float getYmax()
public float getZmax()
public AtomVector getSelectAtoms()
public AtomVector getHighlightAtoms()
protected static Renderer getRenderer()
public boolean contains(Atom a)
a - atom in this querycontains( Bond )public boolean contains(Bond b)
b - bond in this querycontains( Atom )public Atom getAtomFromId(int atomId)
atomId - id of queried atomgetBondFromIdpublic Bond getBondFromId(int bondId)
bondId - id of queried bondgetAtomFromIdpublic void setId(int id)
id - molecule idgetId()public void setMyAtoms(AtomVector atoms)
id - molecule idgetMyAtoms()public void setAtomIdToIndex(java.util.Hashtable index)
index - atomIdToIndexgetAtomIdToIndex()public void setMyBonds(BondVector bv)
bv - bond vectorgetMyBonds()public void setMyRings(RingVector rv)
rv - ring vectorgetMyRings()public void setNumAtoms(int numAtoms)
numAtoms - number of atomsgetNumAtoms()public void setNumRings(int numRings)
numRings - number of ringsgetNumRings()public void setProperties(java.util.Hashtable prop)
prop - property tablegetProperties()public void setMatrix3D(Matrix3D mat)
mat - Matrix3DgetMatrix3D()public void setXmin(float xmin)
prop - property tablegetProperties()public void setYmin(float ymin)
ymin - minimum Y-coordinategetYmin()public void setZmin(float zmin)
ymin - minimum Z-coordinategetZmin()public void setXmax(float xmax)
xmax - maximum X-coordinategetXmax()public void setYmax(float ymax)
ymax - maximum Y-coordinategetYmax()public void setZmax(float zmax)
zmax - maximum Z-coordinategetYmax()public void setSelectAtoms(AtomVector av)
av - atom vectorgetSelectAtoms()public void setHighlightAtoms(AtomVector av)
av - atom vectorgetHighlightAtoms()protected static void setRenderer(Renderer r)
ir - RenderergetRenderer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||