cannot set sketchCarbonVisibility

User f7cf793137

05-02-2015 21:07:06

Hi


I'm trying to set the sketchCarbonVisibility param at the loading time, but the applet uses the previously loaded setting.  The implicitH parameter works fine, but sketchCarbonVisibility does not.  What am I doing wrong?  Can anyone help me?


<script type="text/javascript">
<!--
    var res_width=500;
    var res_height=460;
    msketch_name="MSketch";
    msketch_begin("../../..", res_width, res_height, true);
    msketch_param("licenseFile", "../../../marvin/license.cxl");
    msketch_param("implicitH", "hetero");
    msketch_param("sketchCarbonVisibility", "inChain");    
    msketch_end();
//-->
</script>


Thanks,


Mayumi

ChemAxon 4fa3cf533c

06-02-2015 10:57:27

Hi Mayumi,


The inChain parameter could be a little misleading (we will think it over) because it is the same option as on the Preferences panel, Structure, Carbon labels, At straight angles and implicit H atoms.


Therefore, if you set the implicit H option to hetero, there won't be any implicit hydrogen on the carbon atom, and switch  the carbon visibility option "At straight angles and implicit H atoms" (which is the applet param inChain) on, then, in carbon chains, the carbon labels will be hidden.


I hope it explains the situation, and please, do not hesitate to ask, if you have further questions.


Regards,


Tamas Fazekas-Vigh

User f7cf793137

06-02-2015 15:57:33

Hi Tamas,


Thanks for your reply.  I understand your logic that the implicitH option affects the carbon visibility, but what I'm trying to show you is probably related to the JVM cache. 




Here is an example.  Say, we code it like this.


msketch_param("implicitH", "hetero");
msketch_param("sketchCarbonVisibility", "off");


Step 1:  Load the page and make sure implicitH is "hetero" and carbon label is "never".


Step
2:  On the browser using the applet menu, change the carbon visibility
to "Always" and change the implicitH to "on All" in this order.  Draw something.


Step 3:  Close the browser window.


Step 4:  Reload the page.  The
implicitH resets to "hetero" as specified in the code, but the carbon
label stays as "Always".  Somehow this option is sticky.


Please advise.


Thanks,


Mayumi

ChemAxon 4fa3cf533c

09-02-2015 09:49:47

Hi Mayumi,


Thanks for your feedback. 


The current behavior should be, that if the user sets custom settings on the applet by hand, then we store the changes, and later on we stick to them. This connection is stronger than the applet parameters.


But in your case this seems not to be the case, since for one of the options we stick to the new setting and on the other we use the applet parameter. This seems like a bug. This is why the Implicit H sticks to the applet parameter.


I've created an issue in or issue tracker system for this, and we will investigate it further.


 


Again, thanks for your report.


Regards,


Tamas Fazekas-Vígh

User f7cf793137

11-02-2015 15:38:10

Hi Tamas,


What we want to accomplish is for the applet to load different parameters each time.  In the beginning of the semester, the students will see all carbon labels, but later in the semester, we will display it as "inChain".  The same thing for the hydrogen.  We use "off" in the beginning and change it to "heteroterm" later on.  So, they will get used to the shorthand drawing.


Since we disable the applet menu, the students don't usually change the settings by hand.  But it seems that the stickiness is still there, even if you never touch the settings by hand.


Is there any way to clear the stickiness from the applet API?  We just want to load the applet with different parameters each time.


Mayumi

ChemAxon 4fa3cf533c

12-02-2015 14:06:40

Hi Mayumi,


There is two solution that comes into my mind for this.


First, one option is to manually delete the User/chemaxon/applet/your.website.com.marvin.properties every time when you change the applet parameters.


The other, is to delete the properties file content, and make the file Read-only. Therefore, the applet can't save the newly set properties to this file.


I hope the suggested workarounds works for you, until there is a fix for this.


Best regards,


Tamas Fazekas-Vigh

User f7cf793137

12-02-2015 16:17:47

Hi Tamas,


You know and I know that we cannot ask the students (the end users) to delete files or make it read-only on the client computers.  They could be doing their homework in the school library.  I see that chemaxon.marvin.common.UserSetting class has  setSketchCarbonVisibility(java.lang.String v) and setSketchImplicitH(java.lang.String s).  If I could get this object from Applet, I can call into the methods?  maybe?  When do you think you'll have a fix?


Thanks for your help!


Mayumi

ChemAxon f052bdfe3c

20-02-2015 10:25:44

Hi Mayumi,


According to our plans the fix will be released in version 15.03.9.


Best regards,


Efi 

User f7cf793137

20-02-2015 17:14:05

Thanks for letting me know. 


How are you going to fix it?  Are you going to pick up the parameters without overwriting the property file?  Or are you going to overwrite the property file with the passed parameters at the loading time?  I'm just curious.


Mayumi

ChemAxon d26931946c

23-02-2015 10:41:29

Hi Mayumi,


We haven't worked out the details of the actual solution, but we will inform you when we come up with one.


BRs


Peter

User f7cf793137

13-03-2015 20:26:53

It's working as expected on 15.3.9.  Thank you so much!

ChemAxon 4fa3cf533c

17-03-2015 14:56:44

We are happy to know that the issue has been solved, and sorry for not notifying you as we finished.


Best regards!


Tamas Fazekas-Vigh