Using marvin and create personnal view

User 26c54ae8b9

20-06-2008 08:58:58

Hello Chemaxon,





I want to print on screen some compounds (see like file .jpg) but i don't undestand how to use layout.





I want to print smiles and text in position x,y in a cell but it doesn't work...





Can you give me paramter so as to obtain result like the jpg file.





I have read help section on the chemaxon web but i don't undestand.





Thanks,





Karim.

ChemAxon 7c2d26e5cf

20-06-2008 14:51:28

Do you need a MarvinView table (to print it) with the similar layout than in the following example?


http://www.chemaxon.com/marvin/examples/applets/view/javascripting.html

User 870ab5b546

23-06-2008 01:14:18

There are two questions here:





(1) How does one display a JPG image from a SMILES code?


(2) How does one display images and text in a table?





The answer to the first question is that you can either use the MarvinView applet to display the molecule in a table cell, as Tamas suggested, or you can use the Java API to export the SMILES code into a Molecule object, then export an image into a .jpg file, then load that .jpg file into the Web page using the tag.





The answer to the second question is that you need to learn how to use tables in HTML.

User 26c54ae8b9

23-06-2008 11:47:03

Thanks for response,





Is it possible to use APPLET JAVA with :





A table HTML with 2 rows :


row no1 : print smile to picture with applet JAVA (mview).


row no2 : print text (a command like "print", "echo"...).





Exemple table HTML :





---------------------------------------------------------


applet for picture 1 | text printed 1


---------------------------------------------------------


---------------------------------------------------------


applet for picture 2 | text printed 2


---------------------------------------------------------


---------------------------------------------------------


applet for picture n | text printed n


---------------------------------------------------------


........


..........





Karim.

ChemAxon 7c2d26e5cf

23-06-2008 22:37:33

Hi Karim,


I do not recommend to use seperate applets in each table row/cell. If there are too many applets on the same page, they require a lot of memory and they are very slow. See the Marvin Applets FAQ about this issue.





Instead of that, I can recommend two solutions:





1. Use images instead of applets in the HTML cells. In this case, the image are generated by the Marvin Beans API on the server side.


Please see the following JSP example, it demonstrate how to do it.


http://www.chemaxon.com/test/image-generation/show_image5.jsp





2. Implements the table inside the MarvinView applet.


http://www.chemaxon.com/test/table.html

User 26c54ae8b9

24-06-2008 19:26:07

Thanks Tamas for solution..i will try examples.





Thanks again,





Karim.

User 26c54ae8b9

24-06-2008 21:31:11

I have tested example 2 ( Implements the table inside the MarvinView applet).





I'm sorry but i don't undestand how t use layout parameter...(i have read help online).





How to add a title for each molecule?


How to add a "text3", "text4" .... ?





I must add parameter layout but i don't undestand...sorry?





Thanks,


Karim.

ChemAxon 7c2d26e5cf

24-06-2008 22:48:21

Just give give '\n'-s into the text to wrap it.


Try this example.


http://www.chemaxon.com/test/table1.html


The only difference between my previous example and this one, that a multi line text is given to the applet:


Code:
mview_param("cell0","|CNC|text1\ntext11\ntext12");


mview_param("cell1","|CCCO|text2\ntext22\ntext23");






The following examples helps to understand how to configure table layout:


MarvinView Example - Creating an advanced molecule table


MarvinView Example - Adding advanced components to molecule tables





When you specify the cell layout settings for MarvinView, Marvin renders the cell with GridBagLayout manager. If you are not familiar with this layout manager, I suggest to take a look at its Java tutorial.


Java Tutorials: How to Use GridBagLayout


Hopefully, it helps you to be an expert in the configuration of the layout of the MarvinView table.

User 26c54ae8b9

25-06-2008 08:42:27

ok thanks a lot Tamas !!!


This post is closed.