org.jmol.adapter.smarter
Class SmarterJmolAdapter

java.lang.Object
  extended by org.jmol.api.JmolAdapter
      extended by org.jmol.adapter.smarter.SmarterJmolAdapter

public class SmarterJmolAdapter
extends JmolAdapter


Nested Class Summary
 class SmarterJmolAdapter.StructureIterator
           
 
Nested classes/interfaces inherited from class org.jmol.api.JmolAdapter
JmolAdapter.Logger
 
Field Summary
static java.lang.String PATH_KEY
           
static java.lang.String PATH_SEPARATOR
           
 
Fields inherited from class org.jmol.api.JmolAdapter
logger, ORDER_AROMATIC, ORDER_COVALENT_DOUBLE, ORDER_COVALENT_SINGLE, ORDER_COVALENT_TRIPLE, ORDER_HBOND, ORDER_PARTIAL01, ORDER_PARTIAL12, ORDER_STEREO_FAR, ORDER_STEREO_NEAR
 
Constructor Summary
SmarterJmolAdapter(JmolAdapter.Logger logger)
           
 
Method Summary
 boolean coordinatesAreFractional(java.lang.Object clientFile)
          Get the boolean whether coordinates are fractional.
 void finish(java.lang.Object clientFile)
           
 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.
 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 openBufferedReaders(java.lang.String[] name, java.io.BufferedReader[] bufferedReader)
          Associate a clientFile object with an array of BufferedReader.
 java.lang.Object openDOMReader(java.lang.Object DOMNode)
           
 
Methods inherited from class org.jmol.api.JmolAdapter
canonizeAlphaDigit, canonizeAlternateLocationID, canonizeChainID, canonizeInsertionCode, getClientAtomStringProperty, openBufferedReader, openBufferedReaders, openDOMReader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_KEY

public static final java.lang.String PATH_KEY
See Also:
Constant Field Values

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
Constructor Detail

SmarterJmolAdapter

public SmarterJmolAdapter(JmolAdapter.Logger logger)
Method Detail

finish

public void finish(java.lang.Object clientFile)
Overrides:
finish in class JmolAdapter

openBufferedReader

public java.lang.Object openBufferedReader(java.lang.String name,
                                           java.io.BufferedReader bufferedReader)
Description copied from class: JmolAdapter
Associate a clientFile object with a 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.

Overrides:
openBufferedReader in class JmolAdapter
Parameters:
name - File name, String or URL acting as the source of the reader
bufferedReader - The BufferedReader
Returns:
The clientFile or String with an error message

openBufferedReaders

public java.lang.Object openBufferedReaders(java.lang.String[] name,
                                            java.io.BufferedReader[] bufferedReader)
Description copied from class: JmolAdapter
Associate a clientFile object with an array of 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.

Overrides:
openBufferedReaders in class JmolAdapter
Parameters:
name - File names, String or URL acting as the source of each reader
bufferedReader - The array of BufferedReader
Returns:
The clientFile or String with an error message

openDOMReader

public java.lang.Object openDOMReader(java.lang.Object DOMNode)
Overrides:
openDOMReader in class JmolAdapter

getFileTypeName

public java.lang.String getFileTypeName(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the type of this file or molecular model, if known.

Overrides:
getFileTypeName in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The type of this file or molecular model, default "unknown"

getAtomSetCollectionName

public java.lang.String getAtomSetCollectionName(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the name of the atom set collection, if known.

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.

Overrides:
getAtomSetCollectionName in class JmolAdapter
Returns:
The atom set collection name or null

getAtomSetCollectionProperties

public java.util.Properties getAtomSetCollectionProperties(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the properties for this atomSetCollection.

Not yet implemented everywhere, it is in the smarterJmolAdapter

Overrides:
getAtomSetCollectionProperties in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The properties for this atomSetCollection or null

getAtomSetCount

public int getAtomSetCount(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get number of atomSets in the file.

NOTE WARNING:
Not yet implemented everywhere, it is in the smarterJmolAdapter

Overrides:
getAtomSetCount in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The number of atomSets in the file, default 1

getAtomSetNumber

public int getAtomSetNumber(java.lang.Object clientFile,
                            int atomSetIndex)
Description copied from class: JmolAdapter
Get the number identifying each atomSet.

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

Overrides:
getAtomSetNumber in class JmolAdapter
Parameters:
clientFile - The client file
atomSetIndex - The atom set's index for which to get the atom set number
Returns:
The number identifying each atom set, default atomSetIndex+1.

getAtomSetName

public java.lang.String getAtomSetName(java.lang.Object clientFile,
                                       int atomSetIndex)
Description copied from class: JmolAdapter
Get the name of an atomSet.

Overrides:
getAtomSetName in class JmolAdapter
Parameters:
clientFile - The client file
atomSetIndex - The atom set index
Returns:
The name of the atom set, default the string representation of atomSetIndex

getAtomSetProperties

public java.util.Properties getAtomSetProperties(java.lang.Object clientFile,
                                                 int atomSetIndex)
Description copied from class: JmolAdapter
Get the properties for an atomSet.

Overrides:
getAtomSetProperties in class JmolAdapter
Parameters:
clientFile - The client file
atomSetIndex - The atom set index
Returns:
The properties for an atom set or null

getEstimatedAtomCount

public int getEstimatedAtomCount(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the estimated number of atoms contained in the file.

Just return -1 if you don't know (or don't want to figure it out)

Specified by:
getEstimatedAtomCount in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The estimated number of atoms in the file

coordinatesAreFractional

public boolean coordinatesAreFractional(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the boolean whether coordinates are fractional.

Overrides:
coordinatesAreFractional in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
true if the coordinates are fractional, default false

getNotionalUnitcell

public float[] getNotionalUnitcell(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the notional unit cell.

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

Overrides:
getNotionalUnitcell in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The array of the values or null

getPdbScaleMatrix

public float[] getPdbScaleMatrix(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the PDB scale matrix.

Does not seem to be overriden by any descendent

Overrides:
getPdbScaleMatrix in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The array of 9 floats for the matrix or null

getPdbScaleTranslate

public float[] getPdbScaleTranslate(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get the PDB scale translation vector.

Does not seem to be overriden by any descendent

Overrides:
getPdbScaleTranslate in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
The x, y and z translation values or null

getAtomIterator

public JmolAdapter.AtomIterator getAtomIterator(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get an AtomIterator for retrieval of all atoms in the file.

This method may not return null.

Specified by:
getAtomIterator in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
An AtomIterator
See Also:
JmolAdapter.AtomIterator

getBondIterator

public JmolAdapter.BondIterator getBondIterator(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get a BondIterator for retrieval of all bonds in the file.

If this method returns null and no bonds are defined then the JmolViewer will automatically apply its rebonding code to build bonds between atoms.

Overrides:
getBondIterator in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
A BondIterator or null
See Also:
JmolAdapter.BondIterator

getStructureIterator

public JmolAdapter.StructureIterator getStructureIterator(java.lang.Object clientFile)
Description copied from class: JmolAdapter
Get a StructureIterator.

Overrides:
getStructureIterator in class JmolAdapter
Parameters:
clientFile - The client file
Returns:
A StructureIterator or null