|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmol.api.JmolAdapter
public abstract class JmolAdapter
The JmolAdapter interface defines the API used by the JmolViewer to read external files and fetch atom properties necessary for rendering. A client of the JmolViewer implements this interface on top of their existing molecular model representation. The JmolViewer then requests information from the implementation using this API. Jmol will automatically calculate some atom properties if the client is not capable or does not want to supply them. Note: If you are seeing pink atoms that have lots of bonds, then your methods for getElementNumber(clientAtom) or getElementSymbol(clientAtom) are probably returning stray values. Therefore, these atoms are getting mapped to element 0 (Xx), which has color pink and a relatively large covalent bonding radius.
JmolViewer
,
SmarterJmolAdapter
Nested Class Summary | |
---|---|
class |
JmolAdapter.AtomIterator
AtomIterator is used to enumerate all the clientAtom
objects in a specified frame. |
class |
JmolAdapter.BondIterator
BondIterator is used to enumerate all the bonds |
class |
JmolAdapter.StructureIterator
StructureIterator is used to enumerate Structures Helix, Sheet, Turn |
Field Summary | |
---|---|
(package private) String |
adapterName
|
static short |
ORDER_AROMATIC
|
static short |
ORDER_AROMATIC_DOUBLE
|
static short |
ORDER_AROMATIC_SINGLE
|
static short |
ORDER_COVALENT_DOUBLE
|
static short |
ORDER_COVALENT_SINGLE
|
static short |
ORDER_COVALENT_TRIPLE
|
static short |
ORDER_HBOND
|
static short |
ORDER_PARTIAL01
|
static short |
ORDER_PARTIAL12
|
static short |
ORDER_PARTIAL23
|
static short |
ORDER_PARTIAL32
|
static short |
ORDER_STEREO_FAR
|
static short |
ORDER_STEREO_NEAR
|
static short |
ORDER_UNSPECIFIED
|
static int |
SHELL_D_CARTESIAN
|
static int |
SHELL_D_SPHERICAL
|
static int |
SHELL_F_CARTESIAN
|
static int |
SHELL_F_SPHERICAL
|
static int |
SHELL_L
|
static int |
SHELL_P
|
static int |
SHELL_S
|
static int |
SHELL_SP
|
static String |
SUPPORTED_BASIS_FUNCTIONS
|
Constructor Summary | |
---|---|
JmolAdapter(String adapterName)
|
Method Summary | |
---|---|
static char |
canonizeAlphaDigit(char ch)
|
static char |
canonizeAlternateLocationID(char altLoc)
|
static char |
canonizeChainID(char chainID)
|
static char |
canonizeInsertionCode(char insertionCode)
|
abstract boolean |
coordinatesAreFractional(Object atomSetCollection)
Get the boolean whether coordinates are fractional. |
void |
finish(Object atomSetCollection)
|
String |
getAdapterName()
|
abstract int |
getAtomCount(Object atomSetCollection)
Get the estimated number of atoms contained in the file. |
abstract JmolAdapter.AtomIterator |
getAtomIterator(Object atomSetCollection)
Get an AtomIterator for retrieval of all atoms in the file. |
abstract Hashtable |
getAtomSetAuxiliaryInfo(Object atomSetCollection,
int atomSetIndex)
Get the auxiliary information for a particular atomSet. |
abstract Object |
getAtomSetCollection(Object atomSetCollectionReader)
|
abstract Hashtable |
getAtomSetCollectionAuxiliaryInfo(Object atomSetCollection)
Get the auxiliary information for this atomSetCollection. |
abstract Object |
getAtomSetCollectionFromDOM(Object DOMNode,
Hashtable htParams)
|
Object |
getAtomSetCollectionFromReader(String name,
String type,
BufferedReader bufferedReader,
Hashtable htParams)
all in one -- for TestSmarterJmolAdapter |
abstract Object |
getAtomSetCollectionFromSet(Object readers,
Object atomSets,
Hashtable htParams)
|
abstract String |
getAtomSetCollectionName(Object atomSetCollection)
Get the name of the atom set collection, if known. |
abstract Object |
getAtomSetCollectionOrBufferedReaderFromZip(InputStream is,
String fileName,
String[] zipDirectory,
Hashtable htParams,
boolean asBufferedReader)
|
abstract Object |
getAtomSetCollectionReader(String name,
String type,
BufferedReader bufferedReader,
Hashtable htParams)
Read an atomSetCollection object from a bufferedReader and close the reader. |
abstract Object |
getAtomSetCollectionReaders(JmolFileReaderInterface fileReader,
String[] names,
String[] types,
Hashtable htParams,
boolean getReadersOnly)
Associate a 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. |
abstract JmolAdapter.BondIterator |
getBondIterator(Object atomSetCollection)
Get a BondIterator for retrieval of all bonds in the file. |
static short |
getElementNumber(String elementSymbol)
|
static String |
getElementSymbol(int elementNumber)
|
abstract String |
getFileTypeName(Object atomSetCollection)
Get the type of this file or molecular model, if known. |
static int |
getNaturalIsotope(int elementNumber)
|
abstract float[] |
getNotionalUnitcell(Object atomSetCollection)
Get the notional unit cell. |
abstract float[] |
getPdbScaleMatrix(Object atomSetCollection)
Get the PDB scale matrix. |
abstract float[] |
getPdbScaleTranslate(Object atomSetCollection)
Get the PDB scale translation vector. |
static int |
getQuantumShellTagID(String tag)
|
static int |
getQuantumShellTagIDSpherical(String tag)
|
abstract JmolAdapter.StructureIterator |
getStructureIterator(Object atomSetCollection)
Get a StructureIterator. |
static boolean |
isHetero(String group3)
|
static short |
lookupGroupID(String group3)
|
Object |
openBufferedReader(String name,
BufferedReader bufferedReader)
|
Object |
openBufferedReader(String name,
BufferedReader bufferedReader,
Hashtable htParams)
|
Object |
openBufferedReader(String name,
String type,
BufferedReader bufferedReader)
|
String[] |
specialLoad(String name,
String type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short ORDER_COVALENT_SINGLE
public static final short ORDER_COVALENT_DOUBLE
public static final short ORDER_COVALENT_TRIPLE
public static final short ORDER_AROMATIC
public static final short ORDER_AROMATIC_SINGLE
public static final short ORDER_AROMATIC_DOUBLE
public static final short ORDER_HBOND
public static final short ORDER_STEREO_NEAR
public static final short ORDER_STEREO_FAR
public static final short ORDER_PARTIAL01
public static final short ORDER_PARTIAL12
public static final short ORDER_PARTIAL23
public static final short ORDER_PARTIAL32
public static final short ORDER_UNSPECIFIED
public static final int SHELL_S
public static final int SHELL_P
public static final int SHELL_SP
public static final int SHELL_L
public static final int SHELL_D_SPHERICAL
public static final int SHELL_D_CARTESIAN
public static final int SHELL_F_SPHERICAL
public static final int SHELL_F_CARTESIAN
public static final String SUPPORTED_BASIS_FUNCTIONS
String adapterName
Constructor Detail |
---|
public JmolAdapter(String adapterName)
Method Detail |
---|
public static String getElementSymbol(int elementNumber)
public static short getElementNumber(String elementSymbol)
public static int getNaturalIsotope(int elementNumber)
public static boolean isHetero(String group3)
public static int getQuantumShellTagID(String tag)
public static int getQuantumShellTagIDSpherical(String tag)
public static final short lookupGroupID(String group3)
public String getAdapterName()
public abstract Object getAtomSetCollectionReader(String name, String type, BufferedReader bufferedReader, Hashtable 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 information
public abstract Object getAtomSetCollection(Object atomSetCollectionReader)
public abstract Object getAtomSetCollectionReaders(JmolFileReaderInterface fileReader, String[] names, String[] types, Hashtable 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, Hashtable htParams)
public abstract Object getAtomSetCollectionOrBufferedReaderFromZip(InputStream is, String fileName, String[] zipDirectory, Hashtable htParams, boolean asBufferedReader)
public Object getAtomSetCollectionFromReader(String name, String type, BufferedReader bufferedReader, Hashtable htParams)
name
- type
- bufferedReader
- htParams
-
public Object openBufferedReader(String name, BufferedReader bufferedReader)
public Object openBufferedReader(String name, BufferedReader bufferedReader, Hashtable htParams)
public Object openBufferedReader(String name, String type, BufferedReader bufferedReader)
public abstract Object getAtomSetCollectionFromDOM(Object DOMNode, Hashtable htParams)
public void finish(Object 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 Hashtable getAtomSetCollectionAuxiliaryInfo(Object atomSetCollection)
Via the smarterJmolAdapter
atomSetCollection
- The client file
null
public abstract int getAtomSetCount(Object atomSetCollection)
NOTE WARNING:
Not yet implemented everywhere, it is in the smarterJmolAdapter
atomSetCollection
- The client file
public 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 number
public abstract String getAtomSetName(Object atomSetCollection, int atomSetIndex)
atomSetCollection
- The client fileatomSetIndex
- The atom set index
public abstract Hashtable getAtomSetAuxiliaryInfo(Object atomSetCollection, int atomSetIndex)
Via the smarterJmolAdapter
atomSetCollection
- The client fileatomSetIndex
- The atom set index
null
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 file
public abstract boolean coordinatesAreFractional(Object atomSetCollection)
atomSetCollection
- The client file
false
public abstract float[] getNotionalUnitcell(Object atomSetCollection)
This method returns the parameters that define a crystal unitcell
the parameters are returned in a float[] in the following order
a, b, c, alpha, beta, gamma
a, b, c
: angstroms
alpha, beta, gamma
: degrees
if there is no unit cell data then return null
atomSetCollection
- The client file
null
public abstract float[] getPdbScaleMatrix(Object atomSetCollection)
Does not seem to be overriden by any descendent
atomSetCollection
- The client file
null
public abstract float[] getPdbScaleTranslate(Object atomSetCollection)
Does not seem to be overriden by any descendent
atomSetCollection
- The client file
null
public abstract JmolAdapter.AtomIterator getAtomIterator(Object atomSetCollection)
This method may not return null
.
atomSetCollection
- The client file
JmolAdapter.AtomIterator
public abstract JmolAdapter.BondIterator 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 file
null
JmolAdapter.BondIterator
public abstract JmolAdapter.StructureIterator getStructureIterator(Object atomSetCollection)
atomSetCollection
- The client file
null
public static final char canonizeAlphaDigit(char ch)
public static final char canonizeChainID(char chainID)
public static final char canonizeInsertionCode(char insertionCode)
public static final char canonizeAlternateLocationID(char altLoc)
public String[] specialLoad(String name, String type)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |