User 7a902f260f
19-10-2013 17:58:07
So I have an issue with my code that works on JChem 5.6 but not 6.1. It deals with MSketchPane::setPiece(). What exactly does it do? The API documentation seems sparse as to what it does. We previously have this code snippet:
molEditor_.setPiece(_rgrp);
where molEditor is a MSketchPane and where _rgrp is equal to:
r-group
Marvin 11290416502D
1 0 0 0 0 0 999 V2000
0.0000 0.0000 0.0000 R# 0 0 0 0 0 0 0 0 0 0 0 0
M RGP 1 1 2
M END
We had this hooked into a java swing MouseAdapter where the mouse cursor turns into R1 which then allows the user to put on the structure.
With the upgrade to 6.1, the same code now replaces the entire structure (see attached picture)... similar to setMol(). What method should I be using now?
User 7a902f260f
21-10-2013 21:45:32
Should I provide more information for the above question? I'm not sure if I'm being clear as to what I'm trying to do.
ChemAxon 4fa3cf533c
22-10-2013 14:08:32
Hello Kongar,
I've looked into your issue and found out that it is indeed a bug, setPiece(mol) should not replace the molecule, and the bug has been in since version 6.0.
I put a ticket into our bug tracking system, and we will inform you when the bug has been fixed.
Tamás Fazekas-Vígh
User 7a902f260f
22-10-2013 14:21:24
Thanks for looking into this, Tamas. Is there a workaround that I can use?
ChemAxon 4fa3cf533c
22-10-2013 14:35:16
Sadly, on the public api there is no other option with the same behavior.
User 7a902f260f
22-10-2013 14:44:36
Is there a private API, then? Maybe I can use Java Reflection to force private methods public. A hack will work fine at this point.
We delayed upgrading from 5.6 to 5.12, because we found a bug during the upgrade, and we waited for the fix to show up in 6.1. Now there is another bug that may block us from upgrading yet again...
ChemAxon f052bdfe3c
14-11-2013 15:29:51
I am happy to inform you that the fix was included in Marvin version 6.1.3 ( It can be downloaded from our website. )
Best Regards,
Efi