Hi Miguel,
My idea was to create a reader to read files like this :
<tag to identify the new file format in the SmarterAdapter>
<name>
<file name #1>
...
<file name #n>
So, I tried to create a new reader with the following in the
readAtomSetCollection() method :
for each file name, use the existing SmarterReader/Resolver/xxxReader to
read the file and then merge AtomSetCollection.
Let's take a simple example to explain my problems..
I am using Jmol application to read a file "test.txt" in C:\Tmp. This
file contains the name of 2 other files (test1.xyz, test2.xyz)
The problems I have in the readAtomSetCollection() method :
- how can the method interpret that "test1.xyz" means "C:\Tmp\test1.xyz" ?
the reader is currently reading a file from C:\Tmp, but this information
is not available to the reader.
I would need to have some contextual information (current path to be used)
- currently, the FileManager class do the work to convert a file name
into a BufferedReader, taking care of all local/web stuff.
But the Reader doesn't have a reference to a FileManager object, so I
can't use it in my own Reader.
- currently, the Adapter takes a BufferedReader as its input and creates
an AtomSetCollection,
deciding which Reader to use.
But the Reader doesn't have a reference to an Adapter object, so I can't
use it in my own Reader.
I am not sure I am very clear in my explanations :(
Do you understand the problems I have ?
Nicolas
Miguel wrote:
Miguel, do you know if I can get the main missing informations from the
Reader in the readAtomSetCollection() method :
I do not really understand the question.
- which file is currently being read (especially to have its path)
The readers do not read the information from a file. Instead, they only
read from a BufferedReader.
For example, the molecular model may be read from a String ... as with
loadInline.
- FileManager (to convert a file name to a Stream)
The file manager has code to do this.
In general, the code in the FileManager is ugly and I am not very happy
with it.
- Adapter
The adapter has no concept of files.
For example, the adapter may be reading memory from another in-memory data
representation of the molecule, as with the CdkJmolAdapter.
Miguel
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users