public abstract class JmolAdapter extends Object
JmolViewer
,
SmarterJmolAdapter
Modifier and Type | Field and Description |
---|---|
static String[] |
cellParamNames |
static int |
ORDER_AROMATIC |
static int |
ORDER_AROMATIC_DOUBLE |
static int |
ORDER_AROMATIC_SINGLE |
static int |
ORDER_COVALENT_DOUBLE |
static int |
ORDER_COVALENT_QUAD |
static int |
ORDER_COVALENT_SINGLE |
static int |
ORDER_COVALENT_TRIPLE |
static int |
ORDER_HBOND |
static int |
ORDER_PARTIAL01 |
static int |
ORDER_PARTIAL12 |
static int |
ORDER_PARTIAL23 |
static int |
ORDER_PARTIAL32 |
static int |
ORDER_PYMOL_MULT |
static int |
ORDER_PYMOL_SINGLE |
static int |
ORDER_STEREO_FAR |
static int |
ORDER_STEREO_NEAR |
static int |
ORDER_UNSPECIFIED |
Constructor and Description |
---|
JmolAdapter() |
Modifier and Type | Method and Description |
---|---|
private static char |
canonizeAlphaDigit(char ch) |
static char |
canonizeAlternateLocationID(char altLoc) |
static char |
canonizeInsertionCode(char insertionCode) |
abstract boolean |
coordinatesAreFractional(Object atomSetCollection)
Get the boolean whether coordinates are fractional.
|
abstract void |
finish(Object atomSetCollection) |
abstract int |
getAtomCount(Object atomSetCollection)
Get the estimated number of atoms contained in the file.
|
abstract JmolAdapterAtomIterator |
getAtomIterator(Object atomSetCollection)
Get an AtomIterator for retrieval of all atoms in the file.
|
abstract Map<String,Object> |
getAtomSetAuxiliaryInfo(Object atomSetCollection,
int atomSetIndex)
Get the auxiliary information for a particular atomSet.
|
abstract Object |
getAtomSetCollection(Object atomSetCollectionReader) |
abstract Map<String,Object> |
getAtomSetCollectionAuxiliaryInfo(Object atomSetCollection)
Get the auxiliary information for this atomSetCollection.
|
abstract Object |
getAtomSetCollectionFromDOM(Object DOMNode,
Map<String,Object> htParams) |
abstract Object |
getAtomSetCollectionFromReader(String fname,
Object reader,
Map<String,Object> htParams) |
Object |
getAtomSetCollectionFromReaderType(String name,
String type,
Object bufferedReader,
Map<String,Object> htParams)
all in one -- for TestSmarterJmolAdapter
|
abstract Object |
getAtomSetCollectionFromSet(Object readers,
Object atomSets,
Map<String,Object> htParams) |
abstract String |
getAtomSetCollectionName(Object atomSetCollection)
Get the name of the atom set collection, if known.
|
abstract Object |
getAtomSetCollectionReader(String name,
String type,
Object bufferedReader,
Map<String,Object> htParams)
Read an atomSetCollection object from a bufferedReader and close the reader.
|
abstract Object |
getAtomSetCollectionReaders(JmolFilesReaderInterface fileReader,
String[] names,
String[] types,
Map<String,Object> htParams,
boolean getReadersOnly)
Associate an atomSetCollection object with an array of BufferedReader.
|
abstract int |
getAtomSetCount(Object atomSetCollection)
Get number of atomSets in the file.
|
abstract String |
getAtomSetName(Object atomSetCollection,
int atomSetIndex)
Get the name of an atomSet.
|
abstract int |
getAtomSetNumber(Object atomSetCollection,
int atomSetIndex)
Get the number identifying each atomSet.
|
static float |
getBondingRadius(int atomicNumberWithIsotope,
int charge) |
abstract JmolAdapterBondIterator |
getBondIterator(Object atomSetCollection)
Get a BondIterator for retrieval of all bonds in the file.
|
abstract String[][] |
getBondList(Object atomSetCollection) |
static int |
getElementNumber(String elementSymbol) |
static String |
getElementSymbol(int elementNumber) |
abstract String |
getFileTypeName(Object atomSetCollection)
Get the type of this file or molecular model, if known.
|
abstract int |
getHydrogenAtomCount(Object atomSetCollection)
Get the hydrogen atom count -- for ligand files
|
static int |
getNaturalIsotope(int elementNumber) |
abstract JmolAdapterStructureIterator |
getStructureIterator(Object atomSetCollection)
Get a StructureIterator.
|
Object |
openBufferedReader(String name,
BufferedReader bufferedReader) |
Object |
openBufferedReader(String name,
BufferedReader bufferedReader,
Map<String,Object> htParams) |
Object |
openBufferedReader(String name,
String type,
BufferedReader bufferedReader) |
public static final int ORDER_COVALENT_SINGLE
public static final int ORDER_COVALENT_DOUBLE
public static final int ORDER_COVALENT_TRIPLE
public static final int ORDER_COVALENT_QUAD
public static final int ORDER_AROMATIC
public static final int ORDER_AROMATIC_SINGLE
public static final int ORDER_AROMATIC_DOUBLE
public static final int ORDER_HBOND
public static final int ORDER_STEREO_NEAR
public static final int ORDER_STEREO_FAR
public static final int ORDER_PARTIAL01
public static final int ORDER_PARTIAL12
public static final int ORDER_PARTIAL23
public static final int ORDER_PARTIAL32
public static final int ORDER_UNSPECIFIED
public static final int ORDER_PYMOL_SINGLE
public static final int ORDER_PYMOL_MULT
public static final String[] cellParamNames
public static String getElementSymbol(int elementNumber)
public static int getElementNumber(String elementSymbol)
public static int getNaturalIsotope(int elementNumber)
public static float getBondingRadius(int atomicNumberWithIsotope, int charge)
public abstract Object getAtomSetCollectionReader(String name, String type, Object bufferedReader, Map<String,Object> htParams)
Given the BufferedReader, return an object which represents the file
contents. The parameter name
is assumed to be the
file name or URL which is the source of reader. Note that this 'file'
may have been automatically decompressed. Also note that the name
may be 'String', representing a string constant. Therefore, few
assumptions should be made about the name
parameter.
The return value is an object which represents a atomSetCollection
.
This atomSetCollection
will be passed back in to other methods.
If the return value is instanceof String
then it is
considered an error condition and the returned String is the error
message.
name
- File name, String or URL acting as the source of the readertype
- File type, if known, or nullbufferedReader
- The BufferedReaderhtParams
- a hash table containing parameter informationpublic abstract Object getAtomSetCollectionReaders(JmolFilesReaderInterface fileReader, String[] names, String[] types, Map<String,Object> htParams, boolean getReadersOnly)
Given the array of BufferedReader, return an object which represents
the concatenation of every file contents. The parameter name
is assumed to be the file names or URL which are the source of each
reader. Note that each of this 'file' may have been automatically
decompressed. Also note that the name may be 'String',
representing a string constant. Therefore, few
assumptions should be made about the name
parameter.
The return value is an object which represents a atomSetCollection
.
This atomSetCollection
will be passed back in to other methods.
If the return value is instanceof String
then it is
considered an error condition and the returned String is the error
message.
fileReader
- the thread requesting a set of files if bufferedReaders is nullnames
- File names, String or URL acting as the source of each readertypes
- File types, if known, or nullhtParams
- The input parameters for each file to loadgetReadersOnly
- public abstract Object getAtomSetCollectionFromSet(Object readers, Object atomSets, Map<String,Object> htParams)
public abstract Object getAtomSetCollectionFromReader(String fname, Object reader, Map<String,Object> htParams) throws Exception
Exception
public Object getAtomSetCollectionFromReaderType(String name, String type, Object bufferedReader, Map<String,Object> htParams)
name
- type
- bufferedReader
- htParams
- public Object openBufferedReader(String name, BufferedReader bufferedReader)
public Object openBufferedReader(String name, BufferedReader bufferedReader, Map<String,Object> htParams)
public Object openBufferedReader(String name, String type, BufferedReader bufferedReader)
public abstract Object getAtomSetCollectionFromDOM(Object DOMNode, Map<String,Object> htParams)
public abstract void finish(Object atomSetCollection)
atomSetCollection
- public abstract String getFileTypeName(Object atomSetCollection)
atomSetCollection
- The client file"unknown"
public abstract String getAtomSetCollectionName(Object atomSetCollection)
Some file formats contain a formal name of the molecule in the file.
If this method returns null
then the JmolViewer will
automatically supply the file/URL name as a default.
atomSetCollection
- null
public abstract Map<String,Object> getAtomSetCollectionAuxiliaryInfo(Object atomSetCollection)
Via the smarterJmolAdapter
atomSetCollection
- The client filenull
public abstract int getAtomSetCount(Object atomSetCollection)
NOTE WARNING:
Not yet implemented everywhere, it is in the smarterJmolAdapter
atomSetCollection
- The client filepublic abstract int getAtomSetNumber(Object atomSetCollection, int atomSetIndex)
For a PDB file, this is is the model number. For others it is a 1-based atomSet number.
Note that this is not currently implemented in PdbReader
atomSetCollection
- The client fileatomSetIndex
- The atom set's index for which to get
the atom set numberpublic abstract String getAtomSetName(Object atomSetCollection, int atomSetIndex)
atomSetCollection
- The client fileatomSetIndex
- The atom set indexpublic abstract Map<String,Object> getAtomSetAuxiliaryInfo(Object atomSetCollection, int atomSetIndex)
Via the smarterJmolAdapter
atomSetCollection
- The client fileatomSetIndex
- The atom set indexnull
public abstract int getAtomCount(Object atomSetCollection)
Just return -1 if you don't know (or don't want to figure it out)
atomSetCollection
- The client filepublic abstract int getHydrogenAtomCount(Object atomSetCollection)
atomSetCollection
- public abstract String[][] getBondList(Object atomSetCollection)
atomSetCollection
- public abstract boolean coordinatesAreFractional(Object atomSetCollection)
atomSetCollection
- The client filefalse
public abstract JmolAdapterAtomIterator getAtomIterator(Object atomSetCollection)
This method may not return null
.
atomSetCollection
- The client fileJmolAdapterAtomIterator
public abstract JmolAdapterBondIterator getBondIterator(Object atomSetCollection)
If this method returns null
and no
bonds are defined then the JmolViewer will automatically apply its
rebonding code to build bonds between atoms.
atomSetCollection
- The client filenull
JmolAdapterBondIterator
public abstract JmolAdapterStructureIterator getStructureIterator(Object atomSetCollection)
atomSetCollection
- The client filenull
private static final char canonizeAlphaDigit(char ch)
public static final char canonizeInsertionCode(char insertionCode)
public static final char canonizeAlternateLocationID(char altLoc)