Package org.jmol.adapter.readers.xml
Class XmlCmlReader
java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xml.XmlReader
org.jmol.adapter.readers.xml.XmlCmlReader
- All Implemented Interfaces:
javajs.api.GenericLineReader
- Direct Known Subclasses:
XmlMOReader
A CML2 Reader -
If passed a bufferedReader (from a file or inline string), we
generate a SAX parser and use callbacks to construct an
AtomSetCollection.
If passed a JSObject (from LiveConnect) we treat it as a JS DOM
tree, and walk the tree, (using the same processing as the SAX
parser) to construct the AtomSetCollection.
symmetry added by Bob Hanson:
setSpaceGroupName()
setUnitCellItem()
setFractionalCoordinates()
setAtomCoord()
applySymmetryAndSetTrajectory()
"isotope" added 4/6/2009 Bob Hanson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprotected static final intstate constantsprivate Atom[]private Propertiesprivate intprivate Bond[]private intprivate Stringprivate booleanprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprivate javajs.util.BSprivate booleanprivate booleanprivate booleanprivate javajs.util.Lst<String[]>protected static final intstate constantsprivate intprivate Stringprotected static final intstate constantsprivate intprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected static final intstate constantsprotected Stringprivate intprivate booleanprotected booleanprivate Stringprivate Stringprivate Stringprotected static final intstate constantsprotected intprotected static final intstate constantsprivate intprotected String[]private static final String[]Fields inherited from class org.jmol.adapter.readers.xml.XmlReader
atom, atts, bond, chars, keepChars, parentFields inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addedData, addedDataKey, addVibrations, allow_a_len_1, allowPDBFilter, ANGSTROMS_PER_BOHR, applySymmetryToBonds, asc, baseAtomIndex, baseBondIndex, binaryDoc, bsFilter, bsModels, calculationType, CELL_TYPE_CONVENTIONAL, CELL_TYPE_PRIMITIVE, centroidPacked, continuing, debugging, desiredModelNumber, desiredSpaceGroupIndex, desiredVibrationNumber, doApplySymmetry, doCentralize, doCentroidUnitCell, doCheckUnitCell, doConvertToFractional, doPackUnitCell, doProcessLines, doReadMolecularOrbitals, dssr, fileName, fileOffset, filePath, fileScaling, fillRange, filter, filterAllHetero, filterCased, filterHetero, fixJavaFloat, forcePacked, getHeader, haveAtomFilter, haveModel, havePartialChargeFilter, htParams, ignoreFileSpaceGroupName, ignoreFileSymmetryOperators, ignoreFileUnitCell, ignoreStructure, iHaveFractionalCoordinates, iHaveSymmetryOperators, iHaveUnitCell, is2D, isBinary, isConcatenated, isDSSP1, isFinalized, isMolecular, isPrimitive, isSequential, isTrajectory, latticeCells, latticeScaling, latticeType, line, lstNCS, matUnitCellOrientation, merging, modDim, modelNumber, ms, mustFinalizeModelSet, next, noHydrogens, noPack, optimize2D, out, packingError, paramsCentroid, paramsLattice, prevline, primitiveToCrystal, ptLine, ptSupercell, reader, readerName, requiresBSFilter, reverseModels, rotateHexCell, sgName, slabXY, stateScriptVersionInt, strSupercell, symmetry, templateAtomCount, thisBiomolecule, trajectorySteps, ucItems, unitCellOffset, unitCellParams, useAltNames, useFileModelNumbers, validation, vibrationNumber, vibsFractional, vwr -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprivate voidaddNewBond(String a1, String a2, int order) void(package private) voidbreakOutAtomTokens(String str) (package private) voidbreakOutBondTokens(String str) private voidbreakOutTokens(String str) (package private) voidcheckAtomArrayLength(int newAtomCount) (package private) voidcheckBondArrayLength(int newBondCount) private booleancheckBondToR(String a1name, String a2name) Checks to see if we have a bond to R and, if so, adds this R atom as a key to its attached atomprivate voidcheckUnitCellItem(String[] tags, String value) private voidvoidprivate Stringprivate intgetAtomIndex(String label) private voidprivate intparseBondToken(String str) voidprocessEnd2(String name) (package private) voidprocessEndElement(String name) protected voidprocessStart2(String name) voidprocessStartElement(String name, String nodeName) protected voidprocessXml(XmlReader parent, Object saxReader) the current stateprivate voidMethods inherited from class org.jmol.adapter.readers.xml.XmlReader
createDomNodeJS, finalizeSubclassReader, initializeReader, processDOM, processXml2, setKeepCharsMethods inherited from class org.jmol.adapter.smarter.AtomSetCollectionReader
addAtomXYZSymName, addExplicitLatticeVector, addJmolScript, addSites, addSiteScript, appendLoadNote, appendUunitCellInfo, applySymTrajASCR, checkAndRemoveFilterKey, checkCurrentLineForScript, checkFilterKey, checkLastModel, checkLine, checkLineForScript, clearUnitCell, cloneLastAtomSet, discardLinesUntilBlank, discardLinesUntilContains, discardLinesUntilContains2, discardLinesUntilNonBlank, discardLinesUntilStartsWith, discardPreviousAtoms, doGetModel, doGetVibration, doPreSymmetry, fill3x3, fillDataBlock, fillDataBlockFixed, fillFloatArray, fillFrequencyData, filterAtom, filterReject, finalizeMOData, finalizeModelSet, finalizeReaderASCR, finalizeSubclassSymmetry, forceSymmetry, fractionalizeCoordinates, getElementSymbol, getFilter, getFilterWithCase, getFortranFormatLengths, getInterface, getNewSymmetry, getStrings, getSymmetry, getTokens, getTokensFloat, initializeSymmetry, initializeSymmetryOptions, initializeTrajectoryFile, isLastModel, newAtomSet, parseFloat, parseFloatRange, parseFloatStr, parseInt, parseIntAt, parseIntRange, parseIntStr, parseToken, parseTokenNext, parseTokenRange, parseTokenStr, processBinaryDocument, rd, read3Vectors, readDataObject, readLines, readNextLine, rejectAtomName, RL, set2D, setAtomCoord, setAtomCoordScaled, setAtomCoordTokens, setAtomCoordXYZ, setChainID, setElementAndIsotope, setFilter, setFilterAtomTypeStr, setFractionalCoordinates, setIsPDB, setLoadNote, setModelPDB, setSpaceGroupName, setSymmetryOperator, setTransform, setUnitCell, setUnitCellItem, setup, setupASCR
-
Field Details
-
scalarDictRef
-
scalarDictValue
-
scalarTitle
-
cellParameterType
-
checkedSerial
private boolean checkedSerial -
isSerial
private boolean isSerial -
moleculeNesting
private int moleculeNesting -
latticeVectorPtr
private int latticeVectorPtr -
embeddedCrystal
private boolean embeddedCrystal -
atomIdNames
-
tokens
-
aaLen
private int aaLen -
atomArray
-
bondCount
private int bondCount -
bondArray
-
tokenCount
private int tokenCount -
moduleNestingLevel
private int moduleNestingLevel -
haveMolecule
private boolean haveMolecule -
localSpaceGroupName
-
processing
protected boolean processing -
state
protected int state -
atomIndex0
private int atomIndex0 -
joinList
-
mapRtoA
-
deleteAtoms
private javajs.util.BS deleteAtoms -
moleculeID
-
htModelAtomMap
-
optimize2d
private boolean optimize2d -
START
protected static final int STARTstate constants- See Also:
-
CML
protected static final int CMLstate constants- See Also:
-
CRYSTAL
protected static final int CRYSTALstate constants- See Also:
-
CRYSTAL_SCALAR
protected static final int CRYSTAL_SCALARstate constants- See Also:
-
CRYSTAL_SYMMETRY
protected static final int CRYSTAL_SYMMETRYstate constants- See Also:
-
CRYSTAL_SYMMETRY_TRANSFORM3
protected static final int CRYSTAL_SYMMETRY_TRANSFORM3state constants- See Also:
-
MOLECULE
protected static final int MOLECULEstate constants- See Also:
-
MOLECULE_ATOM_ARRAY
protected static final int MOLECULE_ATOM_ARRAYstate constants- See Also:
-
MOLECULE_ATOM
protected static final int MOLECULE_ATOMstate constants- See Also:
-
MOLECULE_ATOM_SCALAR
protected static final int MOLECULE_ATOM_SCALARstate constants- See Also:
-
MOLECULE_BOND_ARRAY
protected static final int MOLECULE_BOND_ARRAYstate constants- See Also:
-
MOLECULE_BOND
protected static final int MOLECULE_BONDstate constants- See Also:
-
MOLECULE_BOND_STEREO
protected static final int MOLECULE_BOND_STEREOstate constants- See Also:
-
MOLECULE_FORMULA
protected static final int MOLECULE_FORMULAstate constants- See Also:
-
MOLECULE_ATOM_BUILTIN
protected static final int MOLECULE_ATOM_BUILTINstate constants- See Also:
-
MOLECULE_BOND_BUILTIN
protected static final int MOLECULE_BOND_BUILTINstate constants- See Also:
-
MODULE
protected static final int MODULEstate constants- See Also:
-
SYMMETRY
protected static final int SYMMETRYstate constants- See Also:
-
LATTICE_VECTOR
protected static final int LATTICE_VECTORstate constants- See Also:
-
ASSOCIATION
protected static final int ASSOCIATIONstate constants- See Also:
-
unitCellParamTags
-
-
Constructor Details
-
XmlCmlReader
public XmlCmlReader()
-
-
Method Details
-
processXml
the current state- Overrides:
processXmlin classXmlReader- Throws:
Exception
-
processStartElement
- Overrides:
processStartElementin classXmlReadernodeName- TODO
-
processStart2
-
getAtomIndex
-
processEndElement
- Overrides:
processEndElementin classXmlReader
-
processEnd2
-
addBond
-
checkBondToR
Checks to see if we have a bond to R and, if so, adds this R atom as a key to its attached atom- Parameters:
a1name-a2name-- Returns:
- true if handled so no need to add a bond
-
setAtomNames
private void setAtomNames() -
addNewBond
-
fixSerialName
-
getDictRefValue
private void getDictRefValue() -
checkUnitCellItem
-
addAtom
-
parseBondToken
-
breakOutTokens
-
breakOutAtomTokens
-
checkAtomArrayLength
void checkAtomArrayLength(int newAtomCount) -
breakOutBondTokens
-
checkBondArrayLength
void checkBondArrayLength(int newBondCount) -
createNewAtomSet
private void createNewAtomSet() -
applySymmetryAndSetTrajectory
public void applySymmetryAndSetTrajectory()- Overrides:
applySymmetryAndSetTrajectoryin classXmlReader
-
endDocument
public void endDocument()- Overrides:
endDocumentin classXmlReader
-