JAL-3451 JalviewJS embedded mode not resizing
[jalview.git] / site-resources / jalview_embedded_example1.html
index 7163d57..0e0c418 100644 (file)
@@ -4,6 +4,10 @@
 <title>Embedded JalviewJS Example 1</title><meta charset="utf-8" />
 <script src="swingjs/swingjs2.js"></script>
 <script>
+
+// BH 2019.10.06 adds Tree and Pca functionality
+// BH see issue JAL-3451
+
 if (!self.SwingJS)alert('swingjs2.js was not found. It needs to be in swingjs folder in the same directory as ' + document.location.href)
 Info = {
   code: null,
@@ -14,27 +18,29 @@ Info = {
        serverURL: 'https://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php',
        j2sPath: 'swingjs/j2s',
        console:'none',
-       allowjavascript: true,
-       
-       //Jalview-specific:
-       // note that desktop-frame-div has been set to display:none
-       jalview_SCREEN_WIDTH: 0, // desktop width -- 0 to hide
-       jalview_SCREEN_HEIGHT: 0,  // desktop height -- 0 to hide
-       jalview_SCREEN_X: 10,
-       jalview_SCREEN_Y: 10,
-       jalview_EMBEDDED: true
-       
+       allowjavascript: true
 }
 
 jvGet = function(what) {
        switch(what) {
        case "tree":
-       break;
+               testApplet.app.openTreePanel$jalview_gui_AlignFrame$S$S(null, "NJ","BLOSUM62")
+               break;
        case "pca":
-       break;
+               testApplet.app.openPcaPanel$jalview_gui_AlignFrame$S(null, "BLOSUM62")
+               break;
+       case "3D":
+               break;
        }
        
 }
+
+$(document).ready(function() {
+
+  SwingJS.getApplet('testApplet', Info);
+
+});
+
 </script>
 </head>
 <body style="background-image: url(images/coolVeryLightBG.png);">
@@ -116,19 +122,16 @@ jalview-strucddtureviewer-div
 <td valign=top style="padding:20px;background-color:white" >
 One more thing. Let's take a look at the 3D structure of one these proteins. Ferredoxins are important, because they have 
 iron-sulfur clusters that can accept and deliver electrons in metabolic processes. Let's see if we can find it. 
-<br><center><a href="">add the 3D structure</a></center> 
+<br><center><button onclick='jvGet("3D")'>add the 3D structure</button>
 </td></tr></table>
 
 
-<script>
-SwingJS.getApplet('testApplet', Info)
-getClassList = function(){J2S._saveFile('_j2sclasslist.txt', Clazz.ClassFilesLoaded.sort().join('\n'))}
-</script>
-
-
+<!-- debugging (hidden) -->
+<script>getClassList = function(){J2S._saveFile('_j2sclasslist.txt', Clazz.ClassFilesLoaded.sort().join('\n'))}</script>
 <div style="display:none;position:absolute;left:900px;top:30px;width:600px;height:300px;">
 <div id="sysoutdiv" style="border:1px solid green;width:100%;height:95%;overflow:auto"></div>
 This is System.out. <a href="javascript:testApplet._clearConsole()">clear it</a> <br>Add ?j2snocore to URL to see full class list; ?j2sdebug to use uncompressed j2s/core files <br><a href="javascript:getClassList()">get _j2sClassList.txt</a>
 </div>
+
 </body>
 </html>