Class BindingSite

java.lang.Object
  extended byBindingSite

public class BindingSite
extends java.lang.Object

BindingSite holds information about a specific BindingSite including the BindingSiteType, binding state, partner BindingSite (if bound), ID, Domain ID, Subunit ID, Assembly Name, BindingSiteGraphic, and "up" vector. The up vector is a unit vector perpendicular to the binding site. It's used to torsionally align two BindingSites in a bond (the Subunits rotate so that the up vectors for the BindingSites are parallel)


Constructor Summary
BindingSite()
          Constructs a BindingSite with default BindingSiteType, with its ID, domain ID and subunit ID set to -1, set the state of this BindingSite to unbound
BindingSite(BindingSiteType bst, int bsid, int did, int suid, java.lang.String assemName, javax.vecmath.Vector3d pos, javax.vecmath.Quat4d rot, javax.vecmath.Vector3d up)
          Constructs a BindingSite with specified BindingSiteType, ID, domain ID, subunit ID, assembly name, position (relative to the Subunit), rotation (reative to the Subunit), and up vector (relative to the Subunit).
 
Method Summary
 boolean bindTo(BindingSite p)
          Sets the binding state of this and p to bound and adds their partners appropriately.
 boolean breakBond()
          Sets the binding state of this BindingSite and its partner to unbound and removes their partners.
 boolean canBindTo(BindingSite p)
          Returns true if p and this BindingSites can are of compatible BindingSiteTypes (they can bind, in theory)
 void colorBlue()
           
 void colorGreen()
          Colors the graphic for this BindingSite green.
 void colorPink()
           
 void colorYellow()
           
 boolean equals(BindingSite bs)
          Returns true if this BindingSit is the same as bs, false otherwise
 double getAngle()
           
 java.lang.String getAssemName()
          Accessor method to get the name of the Assembly that this BindingSite is a part of.
 BindingSiteType getBST()
          Accessor method to get this BindingSite's BindingSiteType
 BindingSiteGraphic getGraphic()
          Accessor method to get the BindingSiteGraphic for this BindingSite
 int getid()
          Accessor method to get the ID of this BindingSite
 BindingSite getPartner()
          Accessor method to get the partner BindingSite bound to this BindingSite.
 javax.vecmath.Vector3d getPos()
          Accessor method to get the position of this BindingSite relative to its Subunit
 javax.vecmath.Quat4d getRot()
          Accessor method to get the rotation of this BindingSite relative to its Subunit
 int getSubunitID()
          Accessor method to get the subunit ID of this BindingSite
 javax.vecmath.Vector3d getTipPos()
           
 javax.media.j3d.Transform3D getTransform()
          Accessor method to get the Transform of this BindingSite
 javax.vecmath.Vector3d getUp()
          Accessor method to get the up vector for this BindingSite relative to its Subunit
 boolean isBound()
          Accessor method to find out if this BindingSite is bound.
 double length()
          Accessor method to find the length of this BindingSite
 void setAssemName(java.lang.String assemName)
          Mutator method to set the name of the Assembly that this BindingSite is a part of to assemName.
 void setDomainID(int i)
          Mutator method to set the domain ID of this BindingSite to i
 void setid(int i)
          Mutator method to set the ID of this BindingSite to i
 void setPos(javax.vecmath.Vector3d pos)
          Mutator method to set the position of this BindingSite relative to its Subunit to pos
 void setSubunitID(int i)
          Mutator method to set the subunit ID of this BindingSite to i
 java.lang.String toString()
          Return a string representation of this BindingSite, detailing it's ID, the ID of it's BindingSite, whether this BindingSite is bound, and if so, its partner BindingSite's ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BindingSite

public BindingSite()
Constructs a BindingSite with default BindingSiteType, with its ID, domain ID and subunit ID set to -1, set the state of this BindingSite to unbound


BindingSite

public BindingSite(BindingSiteType bst,
                   int bsid,
                   int did,
                   int suid,
                   java.lang.String assemName,
                   javax.vecmath.Vector3d pos,
                   javax.vecmath.Quat4d rot,
                   javax.vecmath.Vector3d up)
Constructs a BindingSite with specified BindingSiteType, ID, domain ID, subunit ID, assembly name, position (relative to the Subunit), rotation (reative to the Subunit), and up vector (relative to the Subunit). A graphic is construced according to the parameters given

Parameters:
bst - BindingSiteType
bsid - int, this BindingSite's ID
did - int, this BindingSite's Domain's ID
suid - int, this BindingSite's Subunit's ID
assemName - String, this BindingSite's Assembly's name
pos - Vector3d, this BindingSite's position relative to its Subunit
rot - Quat4d, this BindingSite's rotation relative to its Subunit
up - Vector, this BindingSite's up vector relative to its Subunit
Method Detail

canBindTo

public boolean canBindTo(BindingSite p)
Returns true if p and this BindingSites can are of compatible BindingSiteTypes (they can bind, in theory)

Parameters:
p - BindingSite
Returns:
boolean

bindTo

public boolean bindTo(BindingSite p)
Sets the binding state of this and p to bound and adds their partners appropriately. If this or p is already bound, returns false. (true otherwise)

Parameters:
p - BindingSite
Returns:
boolean

breakBond

public boolean breakBond()
Sets the binding state of this BindingSite and its partner to unbound and removes their partners. If this was not bound to begin with, returns false. (true otherwise)

Returns:
boolean

isBound

public boolean isBound()
Accessor method to find out if this BindingSite is bound. Returns true when bound, false when not.

Returns:
boolean

colorGreen

public void colorGreen()
Colors the graphic for this BindingSite green. (Useful for debugging)


colorYellow

public void colorYellow()

colorBlue

public void colorBlue()

colorPink

public void colorPink()

length

public double length()
Accessor method to find the length of this BindingSite

Returns:
double

getBST

public BindingSiteType getBST()
Accessor method to get this BindingSite's BindingSiteType

Returns:
BindingSiteType

setid

public void setid(int i)
Mutator method to set the ID of this BindingSite to i

Parameters:
i - int

setDomainID

public void setDomainID(int i)
Mutator method to set the domain ID of this BindingSite to i

Parameters:
i - int

setSubunitID

public void setSubunitID(int i)
Mutator method to set the subunit ID of this BindingSite to i

Parameters:
i - int

getid

public int getid()
Accessor method to get the ID of this BindingSite

Returns:
int

getSubunitID

public int getSubunitID()
Accessor method to get the subunit ID of this BindingSite

Returns:
int

getGraphic

public BindingSiteGraphic getGraphic()
Accessor method to get the BindingSiteGraphic for this BindingSite

Returns:
BindingSiteGraphic

getPos

public javax.vecmath.Vector3d getPos()
Accessor method to get the position of this BindingSite relative to its Subunit

Returns:
Vector3d

getTipPos

public javax.vecmath.Vector3d getTipPos()

getRot

public javax.vecmath.Quat4d getRot()
Accessor method to get the rotation of this BindingSite relative to its Subunit

Returns:
Quat4d

getUp

public javax.vecmath.Vector3d getUp()
Accessor method to get the up vector for this BindingSite relative to its Subunit

Returns:
Quat4d

setPos

public void setPos(javax.vecmath.Vector3d pos)
Mutator method to set the position of this BindingSite relative to its Subunit to pos

Parameters:
pos - Vector3d

getPartner

public BindingSite getPartner()
Accessor method to get the partner BindingSite bound to this BindingSite. Returns null if this BindingSite is not bound.

Returns:
BindingSite

getAssemName

public java.lang.String getAssemName()
Accessor method to get the name of the Assembly that this BindingSite is a part of.

Returns:
String

getAngle

public double getAngle()

setAssemName

public void setAssemName(java.lang.String assemName)
Mutator method to set the name of the Assembly that this BindingSite is a part of to assemName.

Parameters:
assemName - String

getTransform

public javax.media.j3d.Transform3D getTransform()
Accessor method to get the Transform of this BindingSite

Returns:
Transform3D

equals

public boolean equals(BindingSite bs)
Returns true if this BindingSit is the same as bs, false otherwise

Parameters:
bs - BindingSite
Returns:
boolean

toString

public java.lang.String toString()
Return a string representation of this BindingSite, detailing it's ID, the ID of it's BindingSite, whether this BindingSite is bound, and if so, its partner BindingSite's ID.

Returns:
String