Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.xmlcml.cmlimpl.jumbo3
Class JUMBOMoleculeImpl  view JUMBOMoleculeImpl download JUMBOMoleculeImpl.java

java.lang.Object
  extended byPMRElementImpl
      extended byorg.xmlcml.cmlimpl.CMLBaseImpl
          extended byorg.xmlcml.cmlimpl.MoleculeImpl
              extended byorg.xmlcml.cmlimpl.jumbo3.JUMBOMoleculeImpl
All Implemented Interfaces:
org.xmlcml.cml.AbstractBase, org.xmlcml.cml.AttributeConvention, org.xmlcml.cml.AttributeCount, org.xmlcml.cml.AttributeDictRef, org.xmlcml.cml.AttributeId, org.xmlcml.cml.AttributeTitle, org.xmlcml.cml.CMLMolecule, org.w3c.dom.Element, JUMBOMolecule, org.w3c.dom.Node, org.xmlcml.cml.normalise.NormalMolecule, org.xmlcml.cml.query.QueryableMolecule, org.xmlcml.cml.style.StyleableMolecule, org.xmlcml.cml.subset.SubsettableMolecule

public class JUMBOMoleculeImpl
extends org.xmlcml.cmlimpl.MoleculeImpl
implements JUMBOMolecule

CMLMolecule is the basic container for Atoms, Bonds, Electrons Angles, CMLTorsion, Sequences, Features, CMLCrystal and other objects. Molecules may contain other Molecules. When objects such as CMLAtomArray are set or added they are deep-copied, to avoid unpleasant surprises later. In general CMLAtom, CMLAtomArray, CMLBond, CMLBondArray should not be shared between different molecules. A molecule has only one set of Atoms and Bonds - if a molecule is created with CMLAtomArray and an CMLAtom is subsequently added, the components are effectively merged.


Nested Class Summary
 
Nested classes inherited from class org.xmlcml.cmlimpl.MoleculeImpl
 
Field Summary
protected  boolean analysable
           
static JUMBOAtomFactory ATOM_FACTORY
           
static JUMBOBondFactory BOND_FACTORY
           
protected  int displayMode
           
(package private) static org.xmlcml.cml.CMLMolecule DUMMY_1_ATOM_MOLECULE
           
static JUMBOMoleculeFactory MOLECULE_FACTORY
           
protected  boolean multipleAtomSelection
           
protected  boolean multipleBondSelection
           
protected  org.xmlcml.cml.normalise.Normalizer normalizer
           
protected  boolean regularised
           
protected  org.xmlcml.cml.normalise.Regularizer regularizer
           
protected  org.xmlcml.cml.subset.SpanningTree spanningTree
           
protected  org.xmlcml.cml.style.MoleculeStyle style
           
 
Fields inherited from class org.xmlcml.cmlimpl.MoleculeImpl
angleVector, atomArray, atomIdTable, atomVector, bondArray, bondHashTable, bondIdTable, bondVector, count, crystal, electronVector, featureVector, formulaVector, moleculeFactory, moleculeVector, parentMolecule, sequenceVector, torsionVector
 
Fields inherited from class org.xmlcml.cmlimpl.CMLBaseImpl
conventionName, conventionTable, dictionaryEntryPanel, dictRef, id, thisLog, title, treeStyle
 
Fields inherited from interface org.xmlcml.cmlimpl.jumbo3.JUMBOMolecule
JUMBO_MOLECULE_2D_COORDS_ASSUMED, JUMBO_MOLECULE_2D_COORDS_CALCULATED, JUMBO_MOLECULE_BOND_ORDERS_ASSUMED, JUMBO_MOLECULE_BONDS_FROM_3D, JUMBO_MOLECULE_CALCULATED_H_COUNT, JUMBO_MOLECULE_EXISTING_HYDROGENS, JUMBO_MOLECULE_GENERATED_SUBMOLECULES, JUMBO_MOLECULE_GEOMETRIC_HYBRIDIZATION_CALCULATED, JUMBO_MOLECULE_NO_3D, JUMBO_MOLECULE_NO_EXISTING_HYDROGENS, JUMBO_MOLECULE_NO_HYDROGEN_COUNT_ASSUMED, JUMBO_MOLECULE_ZMATRIX_FAILED, JUMBO_MOLECULE_ZMATRIX_TO_3D, messageBodies, messageCodes
 
Fields inherited from interface org.xmlcml.cml.CMLMolecule
COORD2, COORD3, UNKNOWN
 
Fields inherited from interface org.xmlcml.cml.AbstractBase
ANGLE, ATOM, ATOMARRAY, ATOMPARITY, BOND, BONDARRAY, BONDSTEREO, BUILTIN, CML, CML_PREFIX, CRYSTAL, ELECTRON, ELEMENT_COUNT, ELEMENT_NAMES, EXECUTE, FEATURE, FLOAT, FLOAT_TYPE, FLOATARRAY, FLOATMATRIX, FORMULA, INTEGER, INTEGER_TYPE, INTEGERARRAY, LINK, LIST, MOLECULE, NAMESPACE_URI, PACKAGE_NAME, REACTION, SEQUENCE, STRING, STRING_TYPE, STRINGARRAY, TORSION, UNK, UNK_ELEM
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.xmlcml.cml.AttributeTitle
TITLE
 
Fields inherited from interface org.xmlcml.cml.AttributeDictRef
DICTREF
 
Fields inherited from interface org.xmlcml.cml.AttributeId
ID
 
Fields inherited from interface org.xmlcml.cml.AttributeConvention
CONVENTION
 
Fields inherited from interface org.xmlcml.cml.AttributeCount
COUNT
 
Fields inherited from interface org.xmlcml.cml.style.StyleableMolecule
DISPLAYXY, DISPLAYXZ, DISPLAYYZ
 
Constructor Summary
JUMBOMoleculeImpl()
           
JUMBOMoleculeImpl(org.xmlcml.cml.CMLMolecule _mol)
          copy constructor (deep).
JUMBOMoleculeImpl(org.w3c.dom.Document document)
          new CMLMolecule in context
JUMBOMoleculeImpl(org.w3c.dom.Element element)
          replace existing tree nodes by a CMLMolecule
 
Method Summary
(package private)  void addAtomParityToBond(org.xmlcml.cml.CMLBond bond, org.xmlcml.cml.CMLAtomParity parity, org.xmlcml.cml.CMLAtom sharpAtom)
           
 void addKekuleBonds()
           
(package private)  boolean addNextTorsion(java.util.Vector tVector, java.util.Hashtable usedAtomTable)
           
 void addWedgeHatchBonds()
          add wedge/hatch bonds if not already present and we have parities.
 void calculate2DCoords()
          convenience method to generate some sort o 2D coords.
 void calculateBondOrdersFromXYZ3()
          calculate bondorders from coordinates if present
 void calculateBondsFromXYZ3(double tolerance)
          calculate bonds from coordinates if present
 void calculateCoordsFromZMatrix()
           
 void calculateGeometricHybridization()
          get hybridization on geometrical basis calculate SP, SP2, SP3 for atoms and bonds
(package private)  void calculateStartTriangle(org.xmlcml.cml.CMLAtom at0, org.xmlcml.cml.CMLAtom at1, org.xmlcml.cml.CMLAtom at2)
           
(package private)  boolean calculateTriangle(org.xmlcml.cml.CMLAtom at0, org.xmlcml.cml.CMLAtom at1, org.xmlcml.cml.CMLAtom at2)
           
(package private)  void calculateZMCoords(org.xmlcml.cml.CMLAtom at0, org.xmlcml.cml.CMLAtom at1, org.xmlcml.cml.CMLAtom at2, org.xmlcml.cml.CMLAtom at3, org.xmlcml.cml.CMLTorsion torsion)
           
 void clearAtomSelection()
          clear CMLAtom selection NYI
 void clearBondSelection()
          clear CMLBond selection NYI
 void clearWedgeHatchBonds()
          clear wedge and hatch bonds (required if 2DCoords have been recalculated)
(package private)  org.xmlcml.cml.CMLAngle findAngle(org.xmlcml.cml.CMLAtom at0, org.xmlcml.cml.CMLAtom at1, org.xmlcml.cml.CMLAtom at2)
          finds angle in angleVector corresponding to 3 atoms
 void generateSubMolecules()
          split molecule into submolecules (i.e.
 boolean getAnalysable()
           
(package private)  void getAtomCIP()
           
 org.xmlcml.cml.subset.AtomSet getAtomSet()
          extract all atoms
 org.xmlcml.cml.subset.AtomSet getAtomSet(org.xmlcml.cml.subset.AtomSelector atomSelector)
          extract set of atoms; Yet to be refined.
 double getAverageBondDistance(int coordType)
          get the average atom-atom bond distance.
(package private)  void getBondCIP()
           
 org.xmlcml.cml.subset.BondSet getBondSet()
          extract all bonds
 int getDisplayMode()
          get method for drawing molecule
 int getDoubleBondEquivalents()
          create SVG in fileName; use molecule coordinates
static org.xmlcml.cml.CMLMolecule getDummy1AtomMolecule()
           
(package private)  void getHybridizationFromConnectivty()
           
protected  java.lang.String[] getMessageBodies()
           
protected  java.lang.String[] getMessageCodes()
           
 java.util.Vector getNonHydrogenAtoms()
          convenience method: get AtomSet of all nonHydrogen atoms
 org.xmlcml.cml.normalise.Normalizer getNormalizer()
          get normalizer
 org.xmlcml.cml.CMLAtom getPickedAtom(org.xmlcml.cml.CMLCoordinate2 c, java.lang.Double tolerance)
          pick an atom - finds nearest atom within the tolerance limit.
 org.xmlcml.cml.normalise.Regularizer getRegularizer()
          get regularizer
 org.xmlcml.cml.subset.SpanningTree getSpanningTree()
          get spanningTree for molecule.
 org.xmlcml.cml.style.MoleculeStyle getStyle()
          get molecule style
 boolean hasBondOrders()
          returns true if there are any bonds without an explicit order or order is UNKNOWN
protected  void init()
           
 IntSet matchSubstructure(org.xmlcml.cml.query.QueryMolecule query)
          substructure search.
 void multiply2DCoordsBy(double scale)
          scale the coordinates (this should normally only be done for display purposes so only COORD2 is supported
 void paint(java.awt.Graphics2D g, java.awt.geom.AffineTransform scaleMatrix)
          paint to a graphics; use molecule coordinates
 void plusXY2(org.xmlcml.cml.CMLCoordinate2 r)
          increase XY2 coordinates of atoms; if atom.xy2 is null, sets coordinate to r
 void plusXYZ3(org.xmlcml.cml.CMLCoordinate3 p)
          increase XYZ3 coordinates of atoms; if atom.xyz3 is null, sets coordinate to r
 void plusXYZFract(org.xmlcml.cml.CMLCoordinate3 p)
          increase XYZFract coordinates of atoms; if atom.xyzFract is null, sets coordinate to p
(package private)  void processExplicitHydrogens()
           
 void processHydrogens(int mode)
          process all hydrogen atoms and hydrogenCounts in molecule
 void processStereo(int mode)
          process all chiral centres and stereo bonds in molecule
 void regularise()
          regularise the molecule after being read in
 void setAnalysable(boolean analysable)
          to stop proteins, etc.
 void setAtomStyle(org.xmlcml.cml.subset.AtomSet atomSet, org.xmlcml.cml.style.AtomStyle style)
          set atom style for set of atoms
 void setDisplayMode(int displayMode)
          set method for drawing molecule
 void setHighlight(org.xmlcml.cml.subset.AtomSet atomSet, boolean show)
          highlight a group of atoms
 void setMultipleAtomSelection(boolean multiple)
          set multiple CMLAtom selection
 void setMultipleBondSelection(boolean multiple)
          set multiple CMLBond selection
 void setNormalizer(org.xmlcml.cml.normalise.Normalizer normalizer)
          set normalizer
private  void setOtherBondsToSingle(JUMBOAtom atom, JUMBOAtom lig)
           
 void setRegularizer(org.xmlcml.cml.normalise.Regularizer regularizer)
          set regularizer
 void setStyle(org.xmlcml.cml.style.MoleculeStyle style)
          set the style (default is MoleculeStyle.DEFAULT);
 void toSVG(java.lang.String fileName)
          render to a graphics; use molecule coordinates
 void transferTo(org.xmlcml.cml.CMLMolecule toMolecule, org.xmlcml.cml.subset.AtomSet atomSet, org.xmlcml.cml.subset.BondSet bondSet)
          transfer atoms and bonds to another CMLMolecule.
 void transform(Transform2 t)
          transform XY2 coordinates of atoms; if atom.xy2 is null, no op
 
Methods inherited from class org.xmlcml.cmlimpl.MoleculeImpl
addAngle, addAtom, addBond, addElectron, addFeature, addFormula, addMolecule, addSequence, addTorsion, combineSubMolecules, convertFractionalToCartesian, debug, deleteAllAtoms, deleteAllBonds, deleteAngle, deleteAtom, deleteAtomWithId, deleteBond, deleteElectron, deleteFeature, deleteFormula, deleteHasAtomRefs, deleteMolecule, deleteSequence, deleteTorsion, getAngleList, getAngleVector, getAtom, getAtomArray, getAtomById, getAtomCount, getAtomIdTable, getAtomList, getAtomVector, getBond, getBondArray, getBondCount, getBondList, getBondVector, getCalculatedFormula, getClassTagName, getCount, getCrystal, getElectronList, getElectronVector, getFeature, getFeatureList, getFeatureVector, getFormula, getFormulaList, getFormulaVector, getMoleculeList, getMoleculeVector, getRangeCentre, getRangeXY2, getRangeXYZ3, getSequence, getSequenceList, getSequenceVector, getTorsionList, getTorsionVector, hasCoords, isTrace, mergeMolecule, processDOM, processDOMHasCount, setCount, setCrystal, setParentMolecule, setTrace, updateDOM, updateDOMHasCount
 
Methods inherited from class org.xmlcml.cmlimpl.CMLBaseImpl
addToThisLog, addTracer, buildXMLTest, convertChildrenToSubclass, convertToSubclass, copyAndExtractCommonAttributes, createDefaultTreeStyle, debug, getCMLBaseImpl, getConventionName, getDefaultPrefix, getDictionaryEntry, getDictRef, getDisplay, getId, getStringValue, getSubClassedElement, getTableCellEditor, getTableCellEditor, getTableCellRenderer, getTableCellRenderer, getTitle, getTreeStyle, help, main, processDOM, processDOMHasConvention, processDOMHasConvention, processDOMHasCount, processDOMHasDictRef, processDOMHasDictRef, processDOMHasId, processDOMHasId, processDOMHasSize, processDOMHasTitle, processDOMHasTitle, processDOMHasUnits, readXMLTest, removeTracer, setConventionName, setDictionaryEntryPanel, setDictRef, setId, setTitle, setTreeStyle, showDictionaryEntry, showElementNames, test1, trace, updateDOM, updateDOMFromVector, updateDOMHasConvention, updateDOMHasConvention, updateDOMHasCount, updateDOMHasDictRef, updateDOMHasDictRef, updateDOMHasId, updateDOMHasId, updateDOMHasSize, updateDOMHasTitle, updateDOMHasTitle, updateDOMHasUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xmlcml.cml.CMLMolecule
addAngle, addAtom, addBond, addElectron, addFeature, addFormula, addMolecule, addSequence, addTorsion, combineSubMolecules, convertFractionalToCartesian, deleteAllAtoms, deleteAllBonds, deleteAngle, deleteAtom, deleteBond, deleteElectron, deleteFeature, deleteFormula, deleteMolecule, deleteSequence, deleteTorsion, getAngleList, getAngleVector, getAtom, getAtomArray, getAtomById, getAtomCount, getAtomIdTable, getAtomList, getAtomVector, getBond, getBondArray, getBondCount, getBondList, getBondVector, getCalculatedFormula, getCount, getCrystal, getElectronList, getElectronVector, getFeature, getFeatureList, getFeatureVector, getFormula, getFormulaList, getFormulaVector, getMoleculeList, getMoleculeVector, getRangeCentre, getRangeXY2, getRangeXYZ3, getSequence, getSequenceVector, getTorsionList, getTorsionVector, hasCoords, setCount, setCrystal
 
Methods inherited from interface org.xmlcml.cml.AbstractBase
addTracer, debug, debug, getDisplay, processDOM, readXMLTest, removeTracer, setDOMNeedsProcessing, setDOMNeedsUpdating, updateDOM
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 
Methods inherited from interface org.xmlcml.cml.AttributeTitle
getTitle, processDOMHasTitle, setTitle, updateDOMHasTitle
 
Methods inherited from interface org.xmlcml.cml.AttributeDictRef
getDictRef, processDOMHasDictRef, setDictRef, updateDOMHasDictRef
 
Methods inherited from interface org.xmlcml.cml.AttributeId
getId, processDOMHasId, setId, updateDOMHasId
 
Methods inherited from interface org.xmlcml.cml.AttributeConvention
getConventionName, processDOMHasConvention, setConventionName, updateDOMHasConvention
 
Methods inherited from interface org.xmlcml.cml.AttributeCount
processDOMHasCount, updateDOMHasCount
 

Field Detail

ATOM_FACTORY

public static final JUMBOAtomFactory ATOM_FACTORY

BOND_FACTORY

public static final JUMBOBondFactory BOND_FACTORY

MOLECULE_FACTORY

public static final JUMBOMoleculeFactory MOLECULE_FACTORY

DUMMY_1_ATOM_MOLECULE

static org.xmlcml.cml.CMLMolecule DUMMY_1_ATOM_MOLECULE

style

protected org.xmlcml.cml.style.MoleculeStyle style

multipleAtomSelection

protected boolean multipleAtomSelection

multipleBondSelection

protected boolean multipleBondSelection

displayMode

protected int displayMode

spanningTree

protected org.xmlcml.cml.subset.SpanningTree spanningTree

normalizer

protected org.xmlcml.cml.normalise.Normalizer normalizer

regularizer

protected org.xmlcml.cml.normalise.Regularizer regularizer

regularised

protected boolean regularised

analysable

protected boolean analysable
Constructor Detail

JUMBOMoleculeImpl

public JUMBOMoleculeImpl()

JUMBOMoleculeImpl

public JUMBOMoleculeImpl(org.w3c.dom.Element element)
replace existing tree nodes by a CMLMolecule


JUMBOMoleculeImpl

public JUMBOMoleculeImpl(org.w3c.dom.Document document)
new CMLMolecule in context


JUMBOMoleculeImpl

public JUMBOMoleculeImpl(org.xmlcml.cml.CMLMolecule _mol)
                  throws org.xmlcml.cml.CMLException
copy constructor (deep). Copies the complete contents of molecule (but without its document)

Method Detail

getMessageCodes

protected java.lang.String[] getMessageCodes()

getMessageBodies

protected java.lang.String[] getMessageBodies()

init

protected void init()

setNormalizer

public void setNormalizer(org.xmlcml.cml.normalise.Normalizer normalizer)
set normalizer

Specified by:
setNormalizer in interface org.xmlcml.cml.normalise.NormalMolecule

getNormalizer

public org.xmlcml.cml.normalise.Normalizer getNormalizer()
get normalizer

Specified by:
getNormalizer in interface org.xmlcml.cml.normalise.NormalMolecule

setRegularizer

public void setRegularizer(org.xmlcml.cml.normalise.Regularizer regularizer)
set regularizer

Specified by:
setRegularizer in interface org.xmlcml.cml.normalise.NormalMolecule

getRegularizer

public org.xmlcml.cml.normalise.Regularizer getRegularizer()
get regularizer

Specified by:
getRegularizer in interface org.xmlcml.cml.normalise.NormalMolecule

transferTo

public void transferTo(org.xmlcml.cml.CMLMolecule toMolecule,
                       org.xmlcml.cml.subset.AtomSet atomSet,
                       org.xmlcml.cml.subset.BondSet bondSet)
                throws org.xmlcml.cml.CMLException
transfer atoms and bonds to another CMLMolecule. The atoms in the bonds must be in atomSet

Specified by:
transferTo in interface org.xmlcml.cml.subset.SubsettableMolecule

processStereo

public void processStereo(int mode)
                   throws org.xmlcml.cml.CMLException
process all chiral centres and stereo bonds in molecule

Specified by:
processStereo in interface org.xmlcml.cml.normalise.NormalMolecule

regularise

public void regularise()
regularise the molecule after being read in

Specified by:
regularise in interface org.xmlcml.cml.normalise.NormalMolecule

getHybridizationFromConnectivty

void getHybridizationFromConnectivty()

processExplicitHydrogens

void processExplicitHydrogens()

calculateGeometricHybridization

public void calculateGeometricHybridization()
get hybridization on geometrical basis calculate SP, SP2, SP3 for atoms and bonds

Specified by:
calculateGeometricHybridization in interface org.xmlcml.cml.normalise.NormalMolecule

setOtherBondsToSingle

private void setOtherBondsToSingle(JUMBOAtom atom,
                                   JUMBOAtom lig)

hasBondOrders

public boolean hasBondOrders()
returns true if there are any bonds without an explicit order or order is UNKNOWN


calculate2DCoords

public void calculate2DCoords()
                       throws org.xmlcml.cml.CMLException
convenience method to generate some sort o 2D coords. This is not mandatory.

Specified by:
calculate2DCoords in interface org.xmlcml.cml.normalise.NormalMolecule

processHydrogens

public void processHydrogens(int mode)
                      throws org.xmlcml.cml.CMLException
process all hydrogen atoms and hydrogenCounts in molecule

Specified by:
processHydrogens in interface org.xmlcml.cml.normalise.NormalMolecule

setAnalysable

public void setAnalysable(boolean analysable)
Description copied from interface: org.xmlcml.cml.normalise.NormalMolecule
to stop proteins, etc. being analysed (default = true)

Specified by:
setAnalysable in interface org.xmlcml.cml.normalise.NormalMolecule

getAnalysable

public boolean getAnalysable()
Specified by:
getAnalysable in interface org.xmlcml.cml.normalise.NormalMolecule

toSVG

public void toSVG(java.lang.String fileName)
           throws java.io.IOException
render to a graphics; use molecule coordinates

Specified by:
toSVG in interface org.xmlcml.cml.style.StyleableMolecule

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.geom.AffineTransform scaleMatrix)
paint to a graphics; use molecule coordinates

Specified by:
paint in interface org.xmlcml.cml.style.StyleableMolecule

setStyle

public void setStyle(org.xmlcml.cml.style.MoleculeStyle style)
set the style (default is MoleculeStyle.DEFAULT);

Specified by:
setStyle in interface org.xmlcml.cml.style.StyleableMolecule

getStyle

public org.xmlcml.cml.style.MoleculeStyle getStyle()
get molecule style

Specified by:
getStyle in interface org.xmlcml.cml.style.StyleableMolecule

setAtomStyle

public void setAtomStyle(org.xmlcml.cml.subset.AtomSet atomSet,
                         org.xmlcml.cml.style.AtomStyle style)
set atom style for set of atoms

Specified by:
setAtomStyle in interface org.xmlcml.cml.style.StyleableMolecule

setHighlight

public void setHighlight(org.xmlcml.cml.subset.AtomSet atomSet,
                         boolean show)
highlight a group of atoms

Specified by:
setHighlight in interface org.xmlcml.cml.style.StyleableMolecule

getAtomSet

public org.xmlcml.cml.subset.AtomSet getAtomSet()
extract all atoms

Specified by:
getAtomSet in interface org.xmlcml.cml.subset.SubsettableMolecule

getAtomSet

public org.xmlcml.cml.subset.AtomSet getAtomSet(org.xmlcml.cml.subset.AtomSelector atomSelector)
extract set of atoms; Yet to be refined. Primitive sort of search

Specified by:
getAtomSet in interface org.xmlcml.cml.subset.SubsettableMolecule

getBondSet

public org.xmlcml.cml.subset.BondSet getBondSet()
extract all bonds

Specified by:
getBondSet in interface org.xmlcml.cml.subset.SubsettableMolecule

calculateCoordsFromZMatrix

public void calculateCoordsFromZMatrix()
                                throws org.xmlcml.cml.CMLException

calculateStartTriangle

void calculateStartTriangle(org.xmlcml.cml.CMLAtom at0,
                            org.xmlcml.cml.CMLAtom at1,
                            org.xmlcml.cml.CMLAtom at2)
                      throws org.xmlcml.cml.CMLException

calculateTriangle

boolean calculateTriangle(org.xmlcml.cml.CMLAtom at0,
                          org.xmlcml.cml.CMLAtom at1,
                          org.xmlcml.cml.CMLAtom at2)
                    throws org.xmlcml.cml.CMLException

addNextTorsion

boolean addNextTorsion(java.util.Vector tVector,
                       java.util.Hashtable usedAtomTable)
                 throws org.xmlcml.cml.CMLException

calculateZMCoords

void calculateZMCoords(org.xmlcml.cml.CMLAtom at0,
                       org.xmlcml.cml.CMLAtom at1,
                       org.xmlcml.cml.CMLAtom at2,
                       org.xmlcml.cml.CMLAtom at3,
                       org.xmlcml.cml.CMLTorsion torsion)
                 throws org.xmlcml.cml.CMLException

findAngle

org.xmlcml.cml.CMLAngle findAngle(org.xmlcml.cml.CMLAtom at0,
                                  org.xmlcml.cml.CMLAtom at1,
                                  org.xmlcml.cml.CMLAtom at2)
                            throws org.xmlcml.cml.CMLException
finds angle in angleVector corresponding to 3 atoms


calculateBondsFromXYZ3

public void calculateBondsFromXYZ3(double tolerance)
calculate bonds from coordinates if present

Specified by:
calculateBondsFromXYZ3 in interface org.xmlcml.cml.normalise.NormalMolecule

calculateBondOrdersFromXYZ3

public void calculateBondOrdersFromXYZ3()
calculate bondorders from coordinates if present

Specified by:
calculateBondOrdersFromXYZ3 in interface org.xmlcml.cml.normalise.NormalMolecule

plusXY2

public void plusXY2(org.xmlcml.cml.CMLCoordinate2 r)
increase XY2 coordinates of atoms; if atom.xy2 is null, sets coordinate to r

Specified by:
plusXY2 in interface org.xmlcml.cml.normalise.NormalMolecule

transform

public void transform(Transform2 t)
transform XY2 coordinates of atoms; if atom.xy2 is null, no op

Specified by:
transform in interface org.xmlcml.cml.normalise.NormalMolecule

plusXYZ3

public void plusXYZ3(org.xmlcml.cml.CMLCoordinate3 p)
increase XYZ3 coordinates of atoms; if atom.xyz3 is null, sets coordinate to r

Specified by:
plusXYZ3 in interface org.xmlcml.cml.normalise.NormalMolecule

plusXYZFract

public void plusXYZFract(org.xmlcml.cml.CMLCoordinate3 p)
increase XYZFract coordinates of atoms; if atom.xyzFract is null, sets coordinate to p

Specified by:
plusXYZFract in interface org.xmlcml.cml.normalise.NormalMolecule

setDisplayMode

public void setDisplayMode(int displayMode)
set method for drawing molecule

Specified by:
setDisplayMode in interface org.xmlcml.cml.style.StyleableMolecule

getDisplayMode

public int getDisplayMode()
get method for drawing molecule

Specified by:
getDisplayMode in interface org.xmlcml.cml.style.StyleableMolecule

matchSubstructure

public IntSet matchSubstructure(org.xmlcml.cml.query.QueryMolecule query)
Description copied from interface: org.xmlcml.cml.query.QueryableMolecule
substructure search. .

Specified by:
matchSubstructure in interface org.xmlcml.cml.query.QueryableMolecule

getDoubleBondEquivalents

public int getDoubleBondEquivalents()
Description copied from interface: org.xmlcml.cml.normalise.NormalMolecule
create SVG in fileName; use molecule coordinates

Specified by:
getDoubleBondEquivalents in interface org.xmlcml.cml.normalise.NormalMolecule

addKekuleBonds

public void addKekuleBonds()
Specified by:
addKekuleBonds in interface org.xmlcml.cml.normalise.NormalMolecule

getNonHydrogenAtoms

public java.util.Vector getNonHydrogenAtoms()
convenience method: get AtomSet of all nonHydrogen atoms

Specified by:
getNonHydrogenAtoms in interface org.xmlcml.cml.CMLMolecule

addWedgeHatchBonds

public void addWedgeHatchBonds()
add wedge/hatch bonds if not already present and we have parities. If ANY wedge/hatch are set, return without action

Specified by:
addWedgeHatchBonds in interface org.xmlcml.cml.normalise.NormalMolecule

addAtomParityToBond

void addAtomParityToBond(org.xmlcml.cml.CMLBond bond,
                         org.xmlcml.cml.CMLAtomParity parity,
                         org.xmlcml.cml.CMLAtom sharpAtom)
                   throws org.xmlcml.cml.CMLException

clearWedgeHatchBonds

public void clearWedgeHatchBonds()
clear wedge and hatch bonds (required if 2DCoords have been recalculated)

Specified by:
clearWedgeHatchBonds in interface org.xmlcml.cml.normalise.NormalMolecule

getBondCIP

void getBondCIP()

getAtomCIP

void getAtomCIP()

generateSubMolecules

public void generateSubMolecules()
                          throws org.xmlcml.cml.CMLException
split molecule into submolecules (i.e. disjointed fragments). Do this recursively (i.e. if molecule contains a MoleculeVector process all the subMolecules in that

Specified by:
generateSubMolecules in interface org.xmlcml.cml.subset.SubsettableMolecule

getSpanningTree

public org.xmlcml.cml.subset.SpanningTree getSpanningTree()
                                                   throws org.xmlcml.cml.CMLException
get spanningTree for molecule. If more than one, returns null


getAverageBondDistance

public double getAverageBondDistance(int coordType)
get the average atom-atom bond distance. This is primarily for scaling purposes and should not be taken too seriously. If no bonds, returns negative. CoordType is CMLMolecule.COORD2 or COORD3

Specified by:
getAverageBondDistance in interface org.xmlcml.cml.style.StyleableMolecule

multiply2DCoordsBy

public void multiply2DCoordsBy(double scale)
scale the coordinates (this should normally only be done for display purposes so only COORD2 is supported

Specified by:
multiply2DCoordsBy in interface org.xmlcml.cml.style.StyleableMolecule

getPickedAtom

public org.xmlcml.cml.CMLAtom getPickedAtom(org.xmlcml.cml.CMLCoordinate2 c,
                                            java.lang.Double tolerance)
pick an atom - finds nearest atom within the tolerance limit. If no atom is within the tolerance, null is returned. If tolerance is null it is assumed to be infinite - an atom will always be picked.

Specified by:
getPickedAtom in interface org.xmlcml.cml.style.StyleableMolecule

setMultipleAtomSelection

public void setMultipleAtomSelection(boolean multiple)
set multiple CMLAtom selection


setMultipleBondSelection

public void setMultipleBondSelection(boolean multiple)
set multiple CMLBond selection


clearAtomSelection

public void clearAtomSelection()
clear CMLAtom selection NYI


clearBondSelection

public void clearBondSelection()
clear CMLBond selection NYI


getDummy1AtomMolecule

public static org.xmlcml.cml.CMLMolecule getDummy1AtomMolecule()