ffe.lang
Class Bond

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byffe.lang.FNode
          extended byffe.lang.Term
              extended byffe.lang.Bond
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public final class Bond
extends Term

The Bond class represents a covalent bond formed between two atoms.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
static java.util.ArrayList bondpool
           
 
Fields inherited from class ffe.lang.Term
atoms, s
 
Fields inherited from class ffe.lang.FNode
selected
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
Bond(Atom a1, Atom a2, int ord)
           
Bond(java.lang.String n)
          Simple Bond constructor that is intended to be used with the equals method
 
Method Summary
 void destroy()
           
 boolean formsAngleWith(Bond b)
          Check to see if this Bond and another combine to form an angle
 java.util.List getBondList()
          Returns an ArrayList of the Bonds that constitute this Term.
 Atom getCommonAtom(Bond b)
          Finds the common Atom between this Bond and Bond b
 javax.media.j3d.Group getJ3D1()
           
 javax.media.j3d.Group getJ3D2()
           
 Atom getOtherAtom(Atom a)
          Find the other Atom in this Bond
 Atom getOtherAtom(Bond b)
          Find the Atom the this Bond and Bond b don't have in common
 boolean initJ3D()
           
 boolean isVisible()
           
 void reInit(Atom a1, Atom a2, int ord)
           
 boolean sameGroup()
           
 void setAngleWith(Bond b)
          Specifies this Bond helps form an angle with the given Bond
 void setBondTransform3d(javax.media.j3d.Transform3D t3d, double[] pos, double[] orient, double len, boolean newRot)
           
 void setCylinderVisible(boolean v)
           
 void setWire(javax.media.j3d.LineArray l, int i)
           
 void setWireVisible(boolean v)
           
 void switchColor(Atom a)
           
 void switchView(int viewtype)
           
 void update()
          Update recomputes the bonds length
 
Methods inherited from class ffe.lang.Term
equals, getAtom, getAtomList, getBond, getID, getKey, getMM, getValue, print, setAtoms, setBonds, setID_Key, setID, setKey, setMM, setMM, setSelected, setValue, switchColor, toString
 
Methods inherited from class ffe.lang.FNode
drawLabel, findCenter, getFSystemNode, getList, getListIterator, getMoleculeNode, getMW, getName, getPolymerNode, getResidueNode, getTermList, isSelected, setName
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bondpool

public static java.util.ArrayList bondpool
Constructor Detail

Bond

public Bond(Atom a1,
            Atom a2,
            int ord)

Bond

public Bond(java.lang.String n)
Simple Bond constructor that is intended to be used with the equals method

Parameters:
n - Bond id
Method Detail

destroy

public void destroy()
Overrides:
destroy in class Term

formsAngleWith

public boolean formsAngleWith(Bond b)
Check to see if this Bond and another combine to form an angle

Returns:
True if Bond b helps form an angle with this Bond

getBondList

public java.util.List getBondList()
Description copied from class: Term
Returns an ArrayList of the Bonds that constitute this Term.

Overrides:
getBondList in class Term

getCommonAtom

public Atom getCommonAtom(Bond b)
Finds the common Atom between this Bond and Bond b

Parameters:
b - Bond to compare with
Returns:
The Atom the Bonds have in common or Null if they are the same Bond or have no atom in common

getJ3D1

public javax.media.j3d.Group getJ3D1()

getJ3D2

public javax.media.j3d.Group getJ3D2()

getOtherAtom

public Atom getOtherAtom(Atom a)
Find the other Atom in this Bond

Parameters:
a - The known Atom
Returns:
The other Atom that makes up this bond, or Null if Atom a is not part of this bond

getOtherAtom

public Atom getOtherAtom(Bond b)
Find the Atom the this Bond and Bond b don't have in common

Parameters:
b - Bond to compare with
Returns:
The Atom that Bond b and this Bond do not have in common, or Null if they have no Atom in common

initJ3D

public boolean initJ3D()

reInit

public void reInit(Atom a1,
                   Atom a2,
                   int ord)

switchView

public void switchView(int viewtype)
Overrides:
switchView in class Term

switchColor

public void switchColor(Atom a)

update

public void update()
Update recomputes the bonds length

Specified by:
update in class Term

sameGroup

public boolean sameGroup()

setAngleWith

public void setAngleWith(Bond b)
Specifies this Bond helps form an angle with the given Bond

Parameters:
b - Bond that forms an angle with this Bond

setCylinderVisible

public void setCylinderVisible(boolean v)

setBondTransform3d

public void setBondTransform3d(javax.media.j3d.Transform3D t3d,
                               double[] pos,
                               double[] orient,
                               double len,
                               boolean newRot)

setWire

public void setWire(javax.media.j3d.LineArray l,
                    int i)

isVisible

public boolean isVisible()

setWireVisible

public void setWireVisible(boolean v)