org.jmol.adapter.readers.xml

Class XmlCmlReader

public class XmlCmlReader extends XmlReader

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() applySymmetry()
Nested Class Summary
classXmlCmlReader.CmlHandler
Field Summary
Atom[]atomArray
intatomCount
PropertiesatomIdNames
Bond[]bondArray
intbondCount
StringcellParameterType
String[]cmlImplementedAttributes
protected intCML
state constants
protected intCRYSTAL
state constants
protected intCRYSTAL_SCALAR
state constants
protected intCRYSTAL_SYMMETRY
state constants
protected intCRYSTAL_SYMMETRY_TRANSFORM3
state constants
booleanembeddedCrystal
booleanhaveMolecule
intlatticeVectorPtr
StringlocalSpaceGroupName
protected intLATTICE_VECTOR
state constants
intmoduleNestingLevel
intmoleculeNesting
protected intMODULE
state constants
protected intMOLECULE
state constants
protected intMOLECULE_ATOM
state constants
protected intMOLECULE_ATOM_ARRAY
state constants
protected intMOLECULE_ATOM_BUILTIN
state constants
protected intMOLECULE_ATOM_SCALAR
state constants
protected intMOLECULE_BOND
state constants
protected intMOLECULE_BOND_ARRAY
state constants
protected intMOLECULE_BOND_BUILTIN
state constants
protected intMOLECULE_FORMULA
state constants
intnModules
booleanprocessing
StringscalarDictRef
StringscalarDictValue
StringscalarTitle
protected intstate
the current state
protected intSTART
state constants
protected intSYMMETRY
state constants
inttokenCount
String[]tokens
Constructor Summary
XmlCmlReader()
XmlCmlReader(XmlReader parent, AtomSetCollection atomSetCollection, BufferedReader reader, XMLReader xmlReader)
XmlCmlReader(XmlReader parent, AtomSetCollection atomSetCollection, JSObject DOMNode)
Method Summary
voidapplySymmetry()
voidbreakOutAtomTokens(String str)
voidbreakOutBondTokens(String str)
voidbreakOutTokens(String str)
voidcheckAtomArrayLength(int newAtomCount)
voidcheckBondArrayLength(int newBondCount)
voidcreateNewAtomSet(HashMap atts)
voidgetDictRefValue(HashMap atts)
intparseBondToken(String str)
voidprocessEndElement(String uri, String name, String qName)
voidprocessStartElement(String uri, String name, String qName, HashMap atts)

Field Detail

atomArray

private Atom[] atomArray

atomCount

private int atomCount

atomIdNames

private Properties atomIdNames

bondArray

private Bond[] bondArray

bondCount

private int bondCount

cellParameterType

private String cellParameterType

cmlImplementedAttributes

private String[] cmlImplementedAttributes

CML

protected final int CML
state constants

CRYSTAL

protected final int CRYSTAL
state constants

CRYSTAL_SCALAR

protected final int CRYSTAL_SCALAR
state constants

CRYSTAL_SYMMETRY

protected final int CRYSTAL_SYMMETRY
state constants

CRYSTAL_SYMMETRY_TRANSFORM3

protected final int CRYSTAL_SYMMETRY_TRANSFORM3
state constants

embeddedCrystal

private boolean embeddedCrystal

haveMolecule

private boolean haveMolecule

latticeVectorPtr

private int latticeVectorPtr

localSpaceGroupName

private String localSpaceGroupName

LATTICE_VECTOR

protected final int LATTICE_VECTOR
state constants

moduleNestingLevel

private int moduleNestingLevel

moleculeNesting

private int moleculeNesting

MODULE

protected final int MODULE
state constants

MOLECULE

protected final int MOLECULE
state constants

MOLECULE_ATOM

protected final int MOLECULE_ATOM
state constants

MOLECULE_ATOM_ARRAY

protected final int MOLECULE_ATOM_ARRAY
state constants

MOLECULE_ATOM_BUILTIN

protected final int MOLECULE_ATOM_BUILTIN
state constants

MOLECULE_ATOM_SCALAR

protected final int MOLECULE_ATOM_SCALAR
state constants

MOLECULE_BOND

protected final int MOLECULE_BOND
state constants

MOLECULE_BOND_ARRAY

protected final int MOLECULE_BOND_ARRAY
state constants

MOLECULE_BOND_BUILTIN

protected final int MOLECULE_BOND_BUILTIN
state constants

MOLECULE_FORMULA

protected final int MOLECULE_FORMULA
state constants

nModules

private int nModules

processing

private boolean processing

scalarDictRef

private String scalarDictRef

scalarDictValue

private String scalarDictValue

scalarTitle

private String scalarTitle

state

protected int state
the current state

START

protected final int START
state constants

SYMMETRY

protected final int SYMMETRY
state constants

tokenCount

private int tokenCount

tokens

String[] tokens

Constructor Detail

XmlCmlReader

XmlCmlReader()

XmlCmlReader

XmlCmlReader(XmlReader parent, AtomSetCollection atomSetCollection, BufferedReader reader, XMLReader xmlReader)

XmlCmlReader

XmlCmlReader(XmlReader parent, AtomSetCollection atomSetCollection, JSObject DOMNode)

Method Detail

applySymmetry

public void applySymmetry()

breakOutAtomTokens

void breakOutAtomTokens(String str)

breakOutBondTokens

void breakOutBondTokens(String str)

breakOutTokens

void breakOutTokens(String str)

checkAtomArrayLength

void checkAtomArrayLength(int newAtomCount)

checkBondArrayLength

void checkBondArrayLength(int newBondCount)

createNewAtomSet

private void createNewAtomSet(HashMap atts)

getDictRefValue

private void getDictRefValue(HashMap atts)

parseBondToken

int parseBondToken(String str)

processEndElement

public void processEndElement(String uri, String name, String qName)

processStartElement

public void processStartElement(String uri, String name, String qName, HashMap atts)