center molecule in MSketchPane

User 37df300f74

18-05-2010 19:26:26

Hi, I need to put a molecule from smiles in MSKetchPane using setMol function, however the first time I call this function, molecule is partially visible while scrollbar is not centered, but further setMol function call will put molecule in center. Could you let me know how to make sure the first time also put molecule in center? In am with marvin 5.1.7.


Thanks


 

ChemAxon 5433b8e56b

19-05-2010 13:04:53

Hi,


i can not reproduce the problem currently, would you please send me the code segment where you create the MsketchPane object, and that where you call the setMol method with smiles, to be able to check if the problem exists in the newest version of marvin? I'm also interested in the smiles itself also, if that is not confidential.


Currently i can suggest a workaround which should work. Use MolImporter to create a Molecule object from the smiles, and set the Molecule object itself to the MSketchPane instead of the smiles string.


Example to use MolImporter to do this:


Molecule m = MolImporter.importMol(smilesString,"smiles");
sketchpane.setMol(m);

the second string parameter to importMol is important to skip the recognizer subsystem, and directly use smiles import module.


Best regards,
Istvan

User 37df300f74

20-05-2010 15:15:06

Thanks for looking into it.


I forgot to mention that we use MSketchPane inside JNBridge and I manage to resolve it by called it twice in the first time use.


 

ChemAxon e500b51457

24-05-2010 08:36:14

Hello,

We have a long weekend due to our national holiday here, but my colleagues will answer you soon.

Regards,
Erika.

ChemAxon 5433b8e56b

27-05-2010 10:43:57

Hi,


good to hear that you can workaround the problem. I have filed a task to our bug tracking system about the issue. We will fix this inside Marvin and we will notice you in this topic when the fix is ready.


Best wishes,
Istvan

ChemAxon f052bdfe3c

03-01-2014 16:48:21

It was fixed. I am closing this forum topic.