User 694b0b0519
17-05-2005 14:12:29
I can't find how to use this MView function with my applets.
I think i have a problem with the call of those functions as noone of them seems to want to work. The applet just don t show when i'm calling them, here is a sample of the code, i've tried many different things and read the tutorial many times, so i must miss something stupid and easy, anyway here it is :
<SCRIPT LANGUAGE="JavaScript1.1" SRC="/marvin/marvin.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1">
<%int k=0;%>
<!--
function f(cel,at1,at2,at3,sym1,sym2,sym3) {
document.MView1.setAtomExtraLabel(cel,at1,sym1);
document.MView1.setAtomExtraLabel(cel,at2,sym2);
document.MView1.setAtomExtraLabel(cel,at3,sym3);
}
var k=0;
mview_name = "MView1";
mview_begin("/marvin", 1250, 280*<%=nbrow%>);
mview_param("background", "#efefef");
mview_param("molbg", "#efefef");
mview_param("rows", "<%=nbrow%>");
mview_param("cols", "5");
mview_param("border", "1");
mview_param("atomNumbersVisible",true);
mview_param("layout", ":2:1:M:1:0:1:1:s:n:L:0:0:1:1:c:n:0:10");
mview_param("param", ":M:250:250:L:12b");
<% for (int j = 0; j<obj.length; j++) {
String adress = (String)obj[j];
String[] add = adress.split(" ");
String msS = (String)totAdress.get(adress);
%>
mview_param("cell<%=k%>", "|<%=msS%>"+"|Atom <%=add[0]%> : Ar Atom <%=add[1]%> : Ar Atom <%=add[1]%> : Ar");
mview_param("selection<%=k%>","<%=add[0]%>,<%=add[1]%>,<%=add[2]%>");
f(k,<%=new Integer(add[0])%>,<%=new Integer(add[1])%>,<%=new Integer(add[2])%>,"Ar","Ap","Hp");
<%k++;%>
<%}%>
mview_end();
//-->
</SCRIPT>
</CENTER>
It works perfectly when i don't call the F method.
What do you think ?
I think i have a problem with the call of those functions as noone of them seems to want to work. The applet just don t show when i'm calling them, here is a sample of the code, i've tried many different things and read the tutorial many times, so i must miss something stupid and easy, anyway here it is :
<SCRIPT LANGUAGE="JavaScript1.1" SRC="/marvin/marvin.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.1">
<%int k=0;%>
<!--
function f(cel,at1,at2,at3,sym1,sym2,sym3) {
document.MView1.setAtomExtraLabel(cel,at1,sym1);
document.MView1.setAtomExtraLabel(cel,at2,sym2);
document.MView1.setAtomExtraLabel(cel,at3,sym3);
}
var k=0;
mview_name = "MView1";
mview_begin("/marvin", 1250, 280*<%=nbrow%>);
mview_param("background", "#efefef");
mview_param("molbg", "#efefef");
mview_param("rows", "<%=nbrow%>");
mview_param("cols", "5");
mview_param("border", "1");
mview_param("atomNumbersVisible",true);
mview_param("layout", ":2:1:M:1:0:1:1:s:n:L:0:0:1:1:c:n:0:10");
mview_param("param", ":M:250:250:L:12b");
<% for (int j = 0; j<obj.length; j++) {
String adress = (String)obj[j];
String[] add = adress.split(" ");
String msS = (String)totAdress.get(adress);
%>
mview_param("cell<%=k%>", "|<%=msS%>"+"|Atom <%=add[0]%> : Ar Atom <%=add[1]%> : Ar Atom <%=add[1]%> : Ar");
mview_param("selection<%=k%>","<%=add[0]%>,<%=add[1]%>,<%=add[2]%>");
f(k,<%=new Integer(add[0])%>,<%=new Integer(add[1])%>,<%=new Integer(add[2])%>,"Ar","Ap","Hp");
<%k++;%>
<%}%>
mview_end();
//-->
</SCRIPT>
</CENTER>
It works perfectly when i don't call the F method.
What do you think ?