zhen Qixiong wrote:
How are you! Every body,
My Name is Qixiong. I am using CDk to develop software
which can be used to display chemical structure. While
using CDK, I came across some problems.  That is:
1.      I CAN display the chemical structure Correctly on
JFrame + JPanel on a stand-alone application. Here,¡±
Correctly¡±  means the chemical structure image is
correct ,from the eyes of chemists, and the
orientation and dimension for that image are the same
every time while the application is run.
2.      I CAN NOT display the chemical structure Correctly
on a web page, Here ¡°INCORRECTLY¡± means the chemical
structure image is correct ,from the eyes of chemists,
BUT the orientation and dimension for that image
CHANGE every time while the refresh button on web
page, which display the image, was clicked.

Dear Qixiong,

thanks a lot for using the CDK.
Your problem is our problem :-)
Presumably, you are using code which is doing a coordinate generation every time you do a refresh. The behavior that you observe is a known one.
You have two options:

The easy one:
You can use StructureDiagramGenerator only once in the whole process. Once you have generated the coordinates, you can store them and only do a screen refresh if the user presses the refresh button.

The more diffucult one:
You can help us write a "best fit" method for placing the molecule with "new" coordinates such that is best superimposed with the molecule with the "old" coordinates.

To understand what I mean, you can use our editor JChemPaint at http://www.chemistry-development-kit.org
It is based on the same renderer and coordinate generation program.
If you draw a structure and press the clean-up button (with the fork symbol) multiple time, you might observe the behavior that you describt.

So, to make a long story short: Your problem is a shortcoming of the CDK coordinate generation, but can be solved.

To fully understand the problem, it would be helpful to know your code which is executed at refresh time.

Cheers,

Chris

--
Priv. Doz. Dr. Christoph Steinbeck ([EMAIL PROTECTED])
Head of the Research Group for Molecular Informatics
Cologne University BioInformatics Center (http://almost.cubic.uni-koeln.de)
Zülpicher Str. 47, 50674 Cologne
Tel: +49(0)221-470-7426   Fax: +49 (0) 221-470-7786

What is man but that lofty spirit - that sense of enterprise.
... Kirk, "I, Mudd," stardate 4513.3..


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to