GREAT

 

 

  _____  

From: Robert Hanson [mailto:[email protected]] 
Sent: Wednesday, November 04, 2009 1:06 PM
To: [email protected]
Subject: Re: [Jmol-developers] inline clarification

 

I have a similar idea, but it will be more integrated. Cannot work on this
for 5 hours now, but I'm sure I can get it. Definitely not quite that
simple, but close.

Bob



On Wed, Nov 4, 2009 at 1:19 PM, Joe Gatewood <[email protected]> wrote:

Bob,

 

I was looking though the code and found viewer.openReader calling
FileManager.createAtomSetCollectionFromReader

I created a Reader extension than read an array.

 

 

I was able to wrap my class with a BufferedReader and read the array.  I
thought I had a solution but createAtomSetCollectionFromReader opens the
file that Reader is accessing to determine the file type, I think.  The need
to access the file to determine type when the Reader is at hand seems very
odd.  Anyway if I could pass the data type ie "pdb" ,etc to openReader and
then createAtomSetCollectionFromReader used that type instead of setting
type to null as currently implemented I think I would be OK.

 

On the other hand I could hand you a String[] or List<String> and leave the
details to you.

 

Whatever you think best is fine with me.

 

Joe

 

 

  _____  

From: Robert Hanson [mailto:[email protected]] 
Sent: Wednesday, November 04, 2009 11:46 AM


To: [email protected]
Subject: Re: [Jmol-developers] inline clarification

 

It's certainly an interesting idea. The reader is a linear reader, so it
should not matter. I think the method might exclude XML formats and, of
course binary formats, just because those aren't line oriented, but all the
rest are. I wonder.... So what you suggest is replacing a "BufferedReader"
with a "StringArrayReader" in effect. I probably have just enough time to
try that. 

So you will give me a String[] or a Vector?

Bob
 

On Wed, Nov 4, 2009 at 10:53 AM, Joe Gatewood <[email protected]> wrote:

Bob,

I managed to get the data sets with multiple models to load inline.  I had
to increase the heap size.

 

I am currently of the opinion however that loading files from arrays could
be made more efficient.

As you obviously know using the inline approach includes

 

Convert the array of lines to a "really big string" with some form of line
delimiters

Pass this "really big string" to Jmol which then looks for the delimiters
and breaks the string back into an array.

 

All this is just to get the data back into the starting form.

 

Is there a reason we can not just pass an array of data directly to Jmol?

 

Thanks,

Joe

 

 

 

  _____  

From: Robert Hanson [mailto:[email protected]] 
Sent: Monday, November 02, 2009 12:01 PM


To: [email protected]
Subject: Re: [Jmol-developers] inline clarification

 

Joe, there shouldn't be any need to write a file - you are correct; you
should be able to use those directly. The Java StringBuffer is a very
efficient mechanism. Don't use String = String + line. Use 


StringBuffer sb = new StringBuffer();
int nLines = myArrayList.size();
for (int i = 0; i < nLines; i++)
  sb.append(myArrayList.get(nLines)).append('\n');

viewer.loadInline(sb.toString());


That should be equivalent to loading the multiple models as separate models
-- it will automatically create a model for each MODEL statement.

Bob


----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers




-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get. 

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900


----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers




-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get. 

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to