JAL-1807 update
[jalviewjs.git] / site / test.htm
1 <!DOCTYPE html>
2 <html>
3 <title>JalviewJS test</title>
4 <head>
5 <meta charset="utf-8" />
6 <!-- breaking out the library for debugging -->
7 <script type="text/javascript" src="jquery/jquery.js"></script>
8 <script type="text/javascript" src="js/SwingJSjQueryExt.js"></script>
9 <script type="text/javascript" src="js/j2sSwingJS.js"></script>
10 <script type="text/javascript" src="js/SwingJS.js"></script>
11 <script type="text/javascript" src="js/JSmolCore.js"></script>
12 <script type="text/javascript" src="js/JSmol.js"></script>
13
14 <script type="text/javascript">
15
16 Jmol._checkLoad = false; // gets a list of classes loaded when true
17 Jmol._debugCode = false; // this should not be necessary
18 Jmol._isAsync = false; // do not set this true.
19
20 Jmol.getProfile() // records repeat calls to overridden or overloaded Java methods
21
22 var jmolApplet0; // set up in HTML table, below
23
24 // use ?_USE=JAVA or _USE=SIGNED or _USE=HTML5
25
26 jmol_isReady = function(applet) {
27         document.title = (applet._id + " is ready")
28         Jmol._getElement(applet, "appletdiv").style.border="1px solid blue"
29  
30 }               
31
32 Info = {
33     code: "jalview.bin.JalviewLite",
34     resourcePath: "j2s/jalview/resources",
35     file: "http://chemapps.stolaf.edu/jalview/site/uniref50.fa",
36     embedded: true,
37     defaultColour: "Zappo",
38         width: 1050,
39         height: 550,
40         debug: false,
41         color: "#F0F0F0",
42         zIndexBase: 20000,
43         z:{monitorZIndex:100},
44         serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php",
45         use: "HTML5",
46         j2sPath: "j2s",
47         jarPath: "java",
48         isSigned: false,
49         disableJ2SLoadMonitor: false,
50         disableInitialConsole: false,
51         console:"sysoutdiv",
52         readyFunction: jmol_isReady,
53   allowjavascript: true
54 }
55
56
57 function dateTest() {
58
59   Class.loadClass()
60
61   Class.loadClass(
62         "java.text.SimpleDateFormat",
63         function() {
64                 alert(new java.text.SimpleDateFormat($("#date").val()).format(new Date))
65         }
66   );
67 }
68
69 </script>
70 </head>
71 <body>
72 A test page for JalviewJS. 
73
74 <script>
75 SwingJS.getApplet("jalviewApplet", Info)
76 </script>
77 If this is a simple rectangle with a blue outline, it means that the JApplet loaded successfully.  
78 <!-- info <a href="javascript:jalviewApplet._showInfo(true)">show</a>
79 <a href="javascript:jalviewApplet._showInfo(false)">hide</a>
80 -->
81 <div style="position:absolute;left:1250px;top:180px;width:600px;height:300px;">
82 <div id=sysoutdiv style="border:1px solid green;width:100%;height:95%;overflow:auto"></div>
83 This is System.out. <a href="javascript:jalviewApplet._clearConsole()">clear it</a> 
84 Go ahead and open a developer console and type
85 <br>
86 <b> <a href='javascript:System.out.println("Hello, world!")'>System.out.println("Hello, world!")</a></b>
87 <br>
88 <br>
89 <input type=text id=date style="width:200px" value="EEE, d MMM yyyy HH:mm:ss z"> <a href="javascript:dateTest()">SimpleDateFormat test</a>
90  <a href="javascript:alert('The methods listed in the next message are those that are overloaded in such a way -- for example, Color(int r, int g, int b) and Color(float r, float g, float b) -- that make them impossible for Java2Script to differentiate and so must be refactored.'); Clazz.showDuplicates()">Show Duplicates</a>
91 <br> <a href="j2s" target="_blank">Converted Java class directory</a>
92 </div>
93 </div>
94 <img src=javaimage.png />
95 </body>
96 </html>