|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
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.Logger
Logger that writes to stdout |
class |
JmolAdapter.StructureIterator
StructureIterator is used to enumerate Structures Helix, Sheet, Turn |
Field Summary | |
---|---|
JmolAdapter.Logger |
logger
|
static short |
ORDER_AROMATIC
|
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_STEREO_FAR
|
static short |
ORDER_STEREO_NEAR
|
Constructor Summary | |
---|---|
JmolAdapter(java.lang.String adapterName,
JmolAdapter.Logger logger)
|
Method Summary | |
---|---|
static char |
canonizeAlphaDigit(char ch)
|
static char |
canonizeAlternateLocationID(char altLoc)
|
static char |
canonizeChainID(char chainID)
|
static char |
canonizeInsertionCode(char insertionCode)
|
boolean |
coordinatesAreFractional(java.lang.Object clientFile)
Get the boolean whether coordinates are fractional. |
void |
finish(java.lang.Object clientFile)
|
abstract JmolAdapter.AtomIterator |
getAtomIterator(java.lang.Object clientFile)
Get an AtomIterator for retrieval of all atoms in the file. |
java.lang.String |
getAtomSetCollectionName(java.lang.Object clientFile)
Get the name of the atom set collection, if known. |
java.util.Properties |
getAtomSetCollectionProperties(java.lang.Object clientFile)
Get the properties for this atomSetCollection. |
int |
getAtomSetCount(java.lang.Object clientFile)
Get number of atomSets in the file. |
java.lang.String |
getAtomSetName(java.lang.Object clientFile,
int atomSetIndex)
Get the name of an atomSet. |
int |
getAtomSetNumber(java.lang.Object clientFile,
int atomSetIndex)
Get the number identifying each atomSet. |
java.util.Properties |
getAtomSetProperties(java.lang.Object clientFile,
int atomSetIndex)
Get the properties for an atomSet. |
JmolAdapter.BondIterator |
getBondIterator(java.lang.Object clientFile)
Get a BondIterator for retrieval of all bonds in the file. |
java.lang.String |
getClientAtomStringProperty(java.lang.Object clientAtom,
java.lang.String propertyName)
Get a property from a clientAtom. |
abstract int |
getEstimatedAtomCount(java.lang.Object clientFile)
Get the estimated number of atoms contained in the file. |
java.lang.String |
getFileTypeName(java.lang.Object clientFile)
Get the type of this file or molecular model, if known. |
float[] |
getNotionalUnitcell(java.lang.Object clientFile)
Get the notional unit cell. |
float[] |
getPdbScaleMatrix(java.lang.Object clientFile)
Get the PDB scale matrix. |
float[] |
getPdbScaleTranslate(java.lang.Object clientFile)
Get the PDB scale translation vector. |
JmolAdapter.StructureIterator |
getStructureIterator(java.lang.Object clientFile)
Get a StructureIterator. |
java.lang.Object |
openBufferedReader(java.lang.String name,
java.io.BufferedReader bufferedReader)
Associate a clientFile object with a bufferedReader. |
java.lang.Object |
openBufferedReader(java.lang.String name,
java.io.BufferedReader bufferedReader,
JmolAdapter.Logger logger)
|
java.lang.Object |
openBufferedReaders(java.lang.String[] name,
java.io.BufferedReader[] bufferedReader)
Associate a clientFile object with an array of BufferedReader. |
java.lang.Object |
openBufferedReaders(java.lang.String[] name,
java.io.BufferedReader[] bufferedReader,
JmolAdapter.Logger logger)
|
java.lang.Object |
openDOMReader(java.lang.Object DOMNode)
|
java.lang.Object |
openDOMReader(java.lang.Object DOMNode,
JmolAdapter.Logger logger)
|
Methods inherited from class java.lang.Object |
---|
equals, 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_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 JmolAdapter.Logger logger
Constructor Detail |
---|
public JmolAdapter(java.lang.String adapterName, JmolAdapter.Logger logger)
Method Detail |
---|
public java.lang.Object openBufferedReader(java.lang.String name, java.io.BufferedReader bufferedReader)
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 clientFile
.
This clientFile
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 readerbufferedReader
- The BufferedReader
public java.lang.Object openBufferedReader(java.lang.String name, java.io.BufferedReader bufferedReader, JmolAdapter.Logger logger)
name
- File name, String or URL acting as the source of the readerbufferedReader
- The BufferedReaderlogger
- The logger
openBufferedReader(String, BufferedReader)
public java.lang.Object openBufferedReaders(java.lang.String[] name, java.io.BufferedReader[] bufferedReader)
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 clientFile
.
This clientFile
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 names, String or URL acting as the source of each readerbufferedReader
- The array of BufferedReader
public java.lang.Object openBufferedReaders(java.lang.String[] name, java.io.BufferedReader[] bufferedReader, JmolAdapter.Logger logger)
name
- File names, String or URL acting as the source of each readerbufferedReader
- The array of BufferedReaderlogger
- The logger
openBufferedReaders(String[], BufferedReader[])
public java.lang.Object openDOMReader(java.lang.Object DOMNode)
public java.lang.Object openDOMReader(java.lang.Object DOMNode, JmolAdapter.Logger logger)
public void finish(java.lang.Object clientFile)
public java.lang.String getFileTypeName(java.lang.Object clientFile)
clientFile
- The client file
"unknown"
public java.lang.String getAtomSetCollectionName(java.lang.Object clientFile)
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.
clientFile
-
null
public java.util.Properties getAtomSetCollectionProperties(java.lang.Object clientFile)
Not yet implemented everywhere, it is in the smarterJmolAdapter
clientFile
- The client file
null
public int getAtomSetCount(java.lang.Object clientFile)
NOTE WARNING:
Not yet implemented everywhere, it is in the smarterJmolAdapter
clientFile
- The client file
public int getAtomSetNumber(java.lang.Object clientFile, 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
clientFile
- The client fileatomSetIndex
- The atom set's index for which to get
the atom set number
public java.lang.String getAtomSetName(java.lang.Object clientFile, int atomSetIndex)
clientFile
- The client fileatomSetIndex
- The atom set index
public java.util.Properties getAtomSetProperties(java.lang.Object clientFile, int atomSetIndex)
clientFile
- The client fileatomSetIndex
- The atom set index
null
public abstract int getEstimatedAtomCount(java.lang.Object clientFile)
Just return -1 if you don't know (or don't want to figure it out)
clientFile
- The client file
public boolean coordinatesAreFractional(java.lang.Object clientFile)
clientFile
- The client file
false
public float[] getNotionalUnitcell(java.lang.Object clientFile)
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
clientFile
- The client file
null
public float[] getPdbScaleMatrix(java.lang.Object clientFile)
Does not seem to be overriden by any descendent
clientFile
- The client file
null
public float[] getPdbScaleTranslate(java.lang.Object clientFile)
Does not seem to be overriden by any descendent
clientFile
- The client file
null
public java.lang.String getClientAtomStringProperty(java.lang.Object clientAtom, java.lang.String propertyName)
clientAtom
- The clientAtompropertyName
- the key of the property
public abstract JmolAdapter.AtomIterator getAtomIterator(java.lang.Object clientFile)
This method may not return null
.
clientFile
- The client file
JmolAdapter.AtomIterator
public JmolAdapter.BondIterator getBondIterator(java.lang.Object clientFile)
If this method returns null
and no
bonds are defined then the JmolViewer will automatically apply its
rebonding code to build bonds between atoms.
clientFile
- The client file
null
JmolAdapter.BondIterator
public JmolAdapter.StructureIterator getStructureIterator(java.lang.Object clientFile)
clientFile
- 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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |