<!-- <script src="https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.js"></script> -->
<!-- <link type=text/css rel=stylesheet href=https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.css /> -->
- <img src="file:/Users/tcnofoegbu/Documents/workspace/java/dev/jalview/classes/images/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
+ <img src="http://www.jalview.org/help/html/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview." >
</br>
</br>
-<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
<input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
</br>
</br>
<div id="yourDiv">press "Run with JS"</div>
-<input type='hidden' id='seqData' name='seqData' value='{"globalColorScheme":"zappo","seqs":[{"id":"1","start":1,"name":"FER_CAPAA/1-97","seq":"----------------------------------------------------------ASYKVKLITPDGPIEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[],"end":97},{"id":"2","start":1,"name":"FER_CAPAN/1-144","seq":"------MASVSATMISTSFMPRKPAVTSLKPIP-NVG-EALFGLKS---ANGGKVTCMASYKVKLITPDGPIEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[{"xEnd":22,"text":"feature_1","fillColor":"#8c25cd","xStart":2}],"end":144},{"id":"3","start":1,"name":"FER1_SOLLC/1-144","seq":"------MASISGTMISTSFLPRKPAVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPEGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDGNFLDEDQEAAGFVLTCVAYPKGDVTIETHKEEELTA-","features":[],"end":144},{"id":"4","start":1,"name":"Q93XJ9_SOLTU/1-144","seq":"------MASISGTMISTSFLPRKPVVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPDGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDGKFLDDDQEAAGFVLTCVAYPKCDVTIETHKEEELTA-","features":[],"end":144},{"id":"5","start":1,"name":"FER1_PEA/1-149","seq":"---MATTPALYGTAVSTSFLRTQPMPMSVTTTKAFSN--GFLGLKT-SLKRGDLAVAMASYKVKLVTPDGTQEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDGSFLDDEQIEAGFVLTCVAYPTSDVVIETHKEEDLTA-","features":[],"end":149},{"id":"6","start":1,"name":"Q7XA98_TRIPR/1-152","seq":"---MATTPALYGTAVSTSFMRRQPVPMSVATTTTTKAFPSGFGLKSVSTKRGDLAVAMATYKVKLITPEGPQEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDGSFLDDEQIEGGWVLTCVAFPTSDVTIETHKEEELTA-","features":[],"end":152},{"id":"7","start":1,"name":"FER1_MESCR/1-148","seq":"--MAATTAALSGATMSTAFAPKT--PPMTAALPTNVG-RALFGLKS--SASRGRVTAMAAYKVTLVTPEGKQELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDGSFLDDDQIKEGWVLTCVAYPTGDVTIETHKEEELTA-","features":[],"end":148},{"id":"8","start":1,"name":"FER1_SPIOL/1-147","seq":"----MAATTTTMMGMATTFVPKPQAPPMMAALPSNTG-RSLFGLKT--GSRGGRMT-MAAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEELTA-","features":[],"end":147},{"id":"9","start":1,"name":"FER3_RAPSA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDDQIAEGFVLTCAAYPTSDVTIETHREEDMV--","features":[],"end":96},{"id":"10","start":1,"name":"FER1_ARATH/1-148","seq":"----MASTALSSAIVGTSFIRRSPAPISLRSLPSANT-QSLFGLKS-GTARGGRVTAMATYKVKFITPEGELEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDEQIGEGFVLTCAAYPTSDVTIETHKEEDIV--","features":[],"end":148},{"id":"11","start":1,"name":"FER_BRANA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDESFLDDDQIAEGFVLTCAAYPTSDVTIETHKEEELV--","features":[],"end":96},{"id":"12","start":1,"name":"FER2_ARATH/1-148","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDDEQMSEGYVLTCVAYPTSDVVIETHKEEAIM--","features":[],"end":148},{"id":"13","start":1,"name":"Q93Z60_ARATH/1-118","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDD--------------------------------","features":[],"end":118},{"id":"14","start":1,"name":"FER1_MAIZE/1-150","seq":"MATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVG---IMGRSA---SSRRRLRAQATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA","features":[],"end":150},{"id":"15","start":1,"name":"O80429_MAIZE/1-140","seq":"---------MAATALSMSILRAPP-PCFSSPLRLRVAVAKPLAAPM----RRQLLRAQATYNVKLITPEGEVELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDVVIETHKEDDLL--","features":[],"end":140}]}'/>
+<input type='hidden' id='seqData' name='seqData' value='{"globalColorScheme":"zappo","seqs":[{"id":"1","start":1,"name":"FER_CAPAA/1-97","seq":"----------------------------------------------------------ASYKVKLITPDGPIEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[],"end":97},{"id":"2","start":1,"name":"FER_CAPAN/1-144","seq":"------MASVSATMISTSFMPRKPAVTSLKPIP-NVG-EALFGLKS---ANGGKVTCMASYKVKLITPDGPIEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[{"text":"feature_1","xEnd":46,"fillColor":"#8c25cd","xStart":16}],"end":144},{"id":"3","start":1,"name":"FER1_SOLLC/1-144","seq":"------MASISGTMISTSFLPRKPAVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPEGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDGNFLDEDQEAAGFVLTCVAYPKGDVTIETHKEEELTA-","features":[],"end":144},{"id":"4","start":1,"name":"Q93XJ9_SOLTU/1-144","seq":"------MASISGTMISTSFLPRKPVVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPDGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDGKFLDDDQEAAGFVLTCVAYPKCDVTIETHKEEELTA-","features":[],"end":144},{"id":"5","start":1,"name":"FER1_PEA/1-149","seq":"---MATTPALYGTAVSTSFLRTQPMPMSVTTTKAFSN--GFLGLKT-SLKRGDLAVAMASYKVKLVTPDGTQEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDGSFLDDEQIEAGFVLTCVAYPTSDVVIETHKEEDLTA-","features":[],"end":149},{"id":"6","start":1,"name":"Q7XA98_TRIPR/1-152","seq":"---MATTPALYGTAVSTSFMRRQPVPMSVATTTTTKAFPSGFGLKSVSTKRGDLAVAMATYKVKLITPEGPQEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDGSFLDDEQIEGGWVLTCVAFPTSDVTIETHKEEELTA-","features":[{"text":"feature_2","xEnd":24,"fillColor":"#0000cc","xStart":8}],"end":152},{"id":"7","start":1,"name":"FER1_MESCR/1-148","seq":"--MAATTAALSGATMSTAFAPKT--PPMTAALPTNVG-RALFGLKS--SASRGRVTAMAAYKVTLVTPEGKQELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDGSFLDDDQIKEGWVLTCVAYPTGDVTIETHKEEELTA-","features":[],"end":148},{"id":"8","start":1,"name":"FER1_SPIOL/1-147","seq":"----MAATTTTMMGMATTFVPKPQAPPMMAALPSNTG-RSLFGLKT--GSRGGRMT-MAAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEELTA-","features":[],"end":147},{"id":"9","start":1,"name":"FER3_RAPSA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDDQIAEGFVLTCAAYPTSDVTIETHREEDMV--","features":[],"end":96},{"id":"10","start":1,"name":"FER1_ARATH/1-148","seq":"----MASTALSSAIVGTSFIRRSPAPISLRSLPSANT-QSLFGLKS-GTARGGRVTAMATYKVKFITPEGELEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDEQIGEGFVLTCAAYPTSDVTIETHKEEDIV--","features":[],"end":148},{"id":"11","start":1,"name":"FER_BRANA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDESFLDDDQIAEGFVLTCAAYPTSDVTIETHKEEELV--","features":[],"end":96},{"id":"12","start":1,"name":"FER2_ARATH/1-148","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDDEQMSEGYVLTCVAYPTSDVVIETHKEEAIM--","features":[{"text":"feature_3","xEnd":32,"fillColor":"#ffff00","xStart":4}],"end":148},{"id":"13","start":1,"name":"Q93Z60_ARATH/1-118","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDD--------------------------------","features":[],"end":118},{"id":"14","start":1,"name":"FER1_MAIZE/1-150","seq":"MATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVG---IMGRSA---SSRRRLRAQATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA","features":[],"end":150},{"id":"15","start":1,"name":"O80429_MAIZE/1-140","seq":"---------MAATALSMSILRAPP-PCFSSPLRLRVAVAKPLAAPM----RRQLLRAQATYNVKLITPEGEVELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDVVIETHKEDDLL--","features":[],"end":140}],"webStartUrl":"http://www.jalview.org/services/launchApp","jalviewVersion":"Test"}'/>
</body>
</html>
<script>
function toggleMenuVisibility(){
- //alert("toggleMenuVisibility called!");
-
var menu = document.getElementsByClassName("biojs_msa_menubar");
var divToggleButton = document.getElementById("divToggleButton");
if(menu[0].style.display == 'block'){
divToggleButton.value="Hide Menu";
}
}
-function openJalviewUsingCurrentUrl2(){
-var jnpl = "<!--"+
-"Hi!"+
-"If you have downloaded this file after pressing \"Launch Full Application\" from Jalview on a web page and you don't know what to do with this file, you must install Java from http://www.java.sun.com then try opening this file again."+
-" \n"+
-" JNLP generated by /jalviewServlet/services/launchAppDev"+
-" JNLP generated from http://www.jalview.org/builds/develop/webstart/jalview.jnlp"+
-"Available servlet parameters (please URLEncode):"+
-" open=<alignment file URL>"+
-" jvm-max-heap=heap size in M or G"+
-" features maps to '-features'"+
-" treeFile maps to '-tree'"+
-" tree maps to '-tree'"+
-" annotations maps to '-annotations'"+
-" colour maps to '-colour'"+
-" "+
-"-->"+
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?><jnlp spec=\"1.0+\" codebase=\"http://www.jalview.org/builds/develop/webstart\"> <information> <title>Jalview</title> <vendor>The Barton Group</vendor> <homepage href=\"http://www.jalview.org\"/> <description>Jalview Multiple Alignment Editor</description> <description kind=\"short\">Jalview</description> <icon href=\"JalviewLogo_big.png\"/> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version=\"1.7+\" initial-heap-size=\"10M\" max-heap-size=\"2G\"/> <jar href=\"jalview.jar\"/> <jar href=\"JGoogleAnalytics_0.3.jar\"/> <jar href=\"Jmol-12.2.4.jar\"/> <jar href=\"VARNAv3-91.jar\"/> <jar href=\"activation.jar\"/> <jar href=\"apache-mime4j-0.6.jar\"/> <jar href=\"axis.jar\"/> <jar href=\"castor-1.1-cycle-xml.jar\"/> <jar href=\"commons-codec-1.3.jar\"/> <jar href=\"commons-discovery.jar\"/> <jar href=\"commons-logging-1.1.1.jar\"/> <jar href=\"groovy-all-1.8.2.jar\"/> <jar href=\"httpclient-4.0.3.jar\"/> <jar href=\"httpcore-4.0.1.jar\"/> <jar href=\"httpmime-4.0.3.jar\"/> <jar href=\"jalview_jnlp_vm.jar\"/> <jar href=\"jaxrpc.jar\"/> <jar href=\"jdas-1.0.4.jar\"/> <jar href=\"jhall.jar\"/> <jar href=\"json_simple-1.1.jar\"/> <jar href=\"jsoup-1.8.1.jar\"/> <jar href=\"jswingreader-0.3.jar\"/> <jar href=\"log4j-to-slf4j-2.0-rc2.jar\"/> <jar href=\"mail.jar\"/> <jar href=\"miglayout-4.0-swing.jar\"/> <jar href=\"min-jabaws-client-2.1.0.jar\"/> <jar href=\"regex.jar\"/> <jar href=\"saaj.jar\"/> <jar href=\"slf4j-api-1.7.7.jar\"/> <jar href=\"slf4j-log4j12-1.7.7.jar\"/> <jar href=\"spring-core-3.0.5.RELEASE.jar\"/> <jar href=\"spring-web-3.0.5.RELEASE.jar\"/> <jar href=\"vamsas-client.jar\"/> <jar href=\"wsdl4j.jar\"/> <jar href=\"xercesImpl.jar\"/> <jar href=\"xml-apis.jar\"/> <property name=\"jalview.version\" value=\"Development Branch Build\"/> </resources>"+
-"<application-desc main-class=\"jalview.bin.Jalview\">"+
-"<argument>-open</argument>"+
-"<argument>file:///Users/tcnofoegbu/Documents/workspace/java/dev/jalview/examples/example_biojs.html</argument>"+
-"</application-desc>"+
-" <security>"+
-" <all-permissions/>"+
-" </security>"+
-"</jnlp>"
-
-var encodedUri = encodeURI(jnpl);
-window.open(encodedUri)
-//alert(jnpl)
-}
+
function openJalviewUsingCurrentUrl(){
- var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
+ var jalviewData = JSON.parse(document.getElementById("seqData").value)
+ var jalviewVersion = jalviewData['jalviewVersion'];
+ var url = jalviewData['webStartUrl'];
var myForm = document.createElement("form");
myForm.action = url;
- var myInput = document.createElement("input") ;
- myInput.setAttribute("name", "jvm-max-heap") ;
- myInput.setAttribute("value", "2G");
- myForm.appendChild(myInput) ;
+ var heap = document.createElement("input") ;
+ heap.setAttribute("name", "jvm-max-heap") ;
+ heap.setAttribute("value", "2G");
+ myForm.appendChild(heap) ;
- var myInput1 = document.createElement("input") ;
- myInput1.setAttribute("name", "open") ;
- myInput1.setAttribute("value", document.URL);
- myForm.appendChild(myInput1) ;
+ var target = document.createElement("input") ;
+ target.setAttribute("name", "open") ;
+ target.setAttribute("value", document.URL);
+ myForm.appendChild(target) ;
+
+ var jvVersion = document.createElement("input") ;
+ jvVersion.setAttribute("name", "version") ;
+ jvVersion.setAttribute("value", jalviewVersion);
+ myForm.appendChild(jvVersion) ;
-
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
// call render at the end to display the whole MSA
m.render();
-
toggleMenuVisibility();
toggleMenuVisibility();
});
<!-- <script src="https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.js"></script> -->
<!-- <link type=text/css rel=stylesheet href=https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.css /> -->
- <img src="#jalview_logo#" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
+ <img src="http://www.jalview.org/help/html/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview." >
</br>
</br>
-<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
<input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
</br>
</br>
<script>
function toggleMenuVisibility(){
- //alert("toggleMenuVisibility called!");
-
var menu = document.getElementsByClassName("biojs_msa_menubar");
var divToggleButton = document.getElementById("divToggleButton");
if(menu[0].style.display == 'block'){
divToggleButton.value="Hide Menu";
}
}
-function openJalviewUsingCurrentUrl2(){
-var jnpl = "<!--"+
-"Hi!"+
-"If you have downloaded this file after pressing \"Launch Full Application\" from Jalview on a web page and you don't know what to do with this file, you must install Java from http://www.java.sun.com then try opening this file again."+
-" \n"+
-" JNLP generated by /jalviewServlet/services/launchAppDev"+
-" JNLP generated from http://www.jalview.org/builds/develop/webstart/jalview.jnlp"+
-"Available servlet parameters (please URLEncode):"+
-" open=<alignment file URL>"+
-" jvm-max-heap=heap size in M or G"+
-" features maps to '-features'"+
-" treeFile maps to '-tree'"+
-" tree maps to '-tree'"+
-" annotations maps to '-annotations'"+
-" colour maps to '-colour'"+
-" "+
-"-->"+
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?><jnlp spec=\"1.0+\" codebase=\"http://www.jalview.org/builds/develop/webstart\"> <information> <title>Jalview</title> <vendor>The Barton Group</vendor> <homepage href=\"http://www.jalview.org\"/> <description>Jalview Multiple Alignment Editor</description> <description kind=\"short\">Jalview</description> <icon href=\"JalviewLogo_big.png\"/> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version=\"1.7+\" initial-heap-size=\"10M\" max-heap-size=\"2G\"/> <jar href=\"jalview.jar\"/> <jar href=\"JGoogleAnalytics_0.3.jar\"/> <jar href=\"Jmol-12.2.4.jar\"/> <jar href=\"VARNAv3-91.jar\"/> <jar href=\"activation.jar\"/> <jar href=\"apache-mime4j-0.6.jar\"/> <jar href=\"axis.jar\"/> <jar href=\"castor-1.1-cycle-xml.jar\"/> <jar href=\"commons-codec-1.3.jar\"/> <jar href=\"commons-discovery.jar\"/> <jar href=\"commons-logging-1.1.1.jar\"/> <jar href=\"groovy-all-1.8.2.jar\"/> <jar href=\"httpclient-4.0.3.jar\"/> <jar href=\"httpcore-4.0.1.jar\"/> <jar href=\"httpmime-4.0.3.jar\"/> <jar href=\"jalview_jnlp_vm.jar\"/> <jar href=\"jaxrpc.jar\"/> <jar href=\"jdas-1.0.4.jar\"/> <jar href=\"jhall.jar\"/> <jar href=\"json_simple-1.1.jar\"/> <jar href=\"jsoup-1.8.1.jar\"/> <jar href=\"jswingreader-0.3.jar\"/> <jar href=\"log4j-to-slf4j-2.0-rc2.jar\"/> <jar href=\"mail.jar\"/> <jar href=\"miglayout-4.0-swing.jar\"/> <jar href=\"min-jabaws-client-2.1.0.jar\"/> <jar href=\"regex.jar\"/> <jar href=\"saaj.jar\"/> <jar href=\"slf4j-api-1.7.7.jar\"/> <jar href=\"slf4j-log4j12-1.7.7.jar\"/> <jar href=\"spring-core-3.0.5.RELEASE.jar\"/> <jar href=\"spring-web-3.0.5.RELEASE.jar\"/> <jar href=\"vamsas-client.jar\"/> <jar href=\"wsdl4j.jar\"/> <jar href=\"xercesImpl.jar\"/> <jar href=\"xml-apis.jar\"/> <property name=\"jalview.version\" value=\"Development Branch Build\"/> </resources>"+
-"<application-desc main-class=\"jalview.bin.Jalview\">"+
-"<argument>-open</argument>"+
-"<argument>file:///Users/tcnofoegbu/Documents/workspace/java/dev/jalview/examples/example_biojs.html</argument>"+
-"</application-desc>"+
-" <security>"+
-" <all-permissions/>"+
-" </security>"+
-"</jnlp>"
-
-var encodedUri = encodeURI(jnpl);
-window.open(encodedUri)
-//alert(jnpl)
-}
+
function openJalviewUsingCurrentUrl(){
- var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
+ var jalviewData = JSON.parse(document.getElementById("seqData").value)
+ var jalviewVersion = jalviewData['jalviewVersion'];
+ var url = jalviewData['webStartUrl'];
var myForm = document.createElement("form");
myForm.action = url;
- var myInput = document.createElement("input") ;
- myInput.setAttribute("name", "jvm-max-heap") ;
- myInput.setAttribute("value", "2G");
- myForm.appendChild(myInput) ;
+ var heap = document.createElement("input") ;
+ heap.setAttribute("name", "jvm-max-heap") ;
+ heap.setAttribute("value", "2G");
+ myForm.appendChild(heap) ;
- var myInput1 = document.createElement("input") ;
- myInput1.setAttribute("name", "open") ;
- myInput1.setAttribute("value", document.URL);
- myForm.appendChild(myInput1) ;
+ var target = document.createElement("input") ;
+ target.setAttribute("name", "open") ;
+ target.setAttribute("value", document.URL);
+ myForm.appendChild(target) ;
+
+ var jvVersion = document.createElement("input") ;
+ jvVersion.setAttribute("name", "version") ;
+ jvVersion.setAttribute("value", jalviewVersion);
+ myForm.appendChild(jvVersion) ;
-
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
// call render at the end to display the whole MSA
m.render();
-
toggleMenuVisibility();
toggleMenuVisibility();
});
--- /dev/null
+package jalview.exceptions;
+
+@SuppressWarnings("serial")
+public class JalviewException extends Exception
+{
+ public JalviewException(String exceptionMessage)
+ {
+ super(exceptionMessage);
+ }
+
+ public JalviewException()
+ {
+ super();
+ }
+
+ public JalviewException(String exceptionMessage, Throwable cause)
+ {
+ super(exceptionMessage, cause);
+ }
+
+ public JalviewException(Throwable cause)
+ {
+ super(cause);
+ }
+}
--- /dev/null
+package jalview.exceptions;
+
+@SuppressWarnings("serial")
+public class NoFileSelectedException extends JalviewException
+{
+ public NoFileSelectedException(String msg)
+ {
+ super(msg);
+ }
+}
public void bioJSMenuItem_actionPerformed(ActionEvent e)
{
new BioJsHTMLOutput(alignPanel,
- alignPanel.seqPanel.seqCanvas.getSequenceRenderer(),
alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
}
public void createImageMap(File file, String image)
* Keys are the feature types which are currently visible. Note: Values are
* not used!
*/
- Hashtable featuresDisplayed = null;
+ private Hashtable featuresDisplayed = null;
boolean antiAlias = false;
Cache.log.debug("trigger update for " + calcId);
}
}
+
+ public Hashtable getFeaturesDisplayed()
+ {
+ return featuresDisplayed;
+ }
+
+ public void setFeaturesDisplayed(Hashtable featuresDisplayed)
+ {
+ this.featuresDisplayed = featuresDisplayed;
+ }
}
private Hashtable getDisplayedFeatureCols()
{
Hashtable fcols = new Hashtable();
- if (ap.av.featuresDisplayed == null)
+ if (ap.av.getFeaturesDisplayed() == null)
{
return fcols;
}
- Enumeration en = ap.av.featuresDisplayed.keys();
+ Enumeration en = ap.av.getFeaturesDisplayed().keys();
FeatureRenderer fr = ap.seqPanel.seqCanvas.getFeatureRenderer(); // consider
// higher
// level
// copy over the displayed feature settings
if (fr.av != null)
{
- if (fr.av.featuresDisplayed != null)
+ if (fr.av.getFeaturesDisplayed() != null)
{
// update display settings
- if (av.featuresDisplayed == null)
+ if (av.getFeaturesDisplayed() == null)
{
- av.featuresDisplayed = new Hashtable(fr.av.featuresDisplayed);
+ av.setFeaturesDisplayed(new Hashtable(fr.av.getFeaturesDisplayed()));
}
else
{
- av.featuresDisplayed.clear();
- Enumeration en = fr.av.featuresDisplayed.keys();
+ av.getFeaturesDisplayed().clear();
+ Enumeration en = fr.av.getFeaturesDisplayed().keys();
while (en.hasMoreElements())
{
- av.featuresDisplayed.put(en.nextElement(), Boolean.TRUE);
+ av.getFeaturesDisplayed().put(en.nextElement(), Boolean.TRUE);
}
}
fm = g.getFontMetrics();
}
- if (av.featuresDisplayed == null || renderOrder == null
+ if (av.getFeaturesDisplayed() == null || renderOrder == null
|| newFeatureAdded)
{
findAllFeatures();
- if (av.featuresDisplayed.size() < 1)
+ if (av.getFeaturesDisplayed().size() < 1)
{
return;
}
{
type = renderOrder[renderIndex];
- if (type == null || !av.featuresDisplayed.containsKey(type))
+ if (type == null || !av.getFeaturesDisplayed().containsKey(type))
{
continue;
}
findingFeatures = true;
- if (av.featuresDisplayed == null)
+ if (av.getFeaturesDisplayed() == null)
{
- av.featuresDisplayed = new Hashtable();
+ av.setFeaturesDisplayed(new Hashtable());
}
allfeatures = new Vector();
int index = 0;
while (index < features.length)
{
- if (!av.featuresDisplayed.containsKey(features[index].getType()))
+ if (!av.getFeaturesDisplayed().containsKey(features[index].getType()))
{
if (featureGroups.containsKey(features[index].getType()))
{
// this is a new feature type on the alignment. Mark it for
// display.
- av.featuresDisplayed.put(features[index].getType(),
+ av.getFeaturesDisplayed().put(features[index].getType(),
new Integer(getColour(features[index].getType())
.getRGB()));
setOrder(features[index].getType(), 0);
sf.description = lastDescriptionAdded;
setColour(sf.type, fcol);
- av.featuresDisplayed.put(sf.type, getColour(sf.type));
+ av.getFeaturesDisplayed().put(sf.type, getColour(sf.type));
try
{
ffile.parseDescriptionHTML(features[i], false);
}
- if (av.featuresDisplayed == null)
+ if (av.getFeaturesDisplayed() == null)
{
- av.featuresDisplayed = new Hashtable();
+ av.setFeaturesDisplayed(new Hashtable());
}
if (lastFeatureGroupAdded != null)
featureGroups.put(lastFeatureGroupAdded, new Boolean(true));
}
setColour(lastFeatureAdded, fcol);
- av.featuresDisplayed.put(lastFeatureAdded,
+ av.getFeaturesDisplayed().put(lastFeatureAdded,
getColour(lastFeatureAdded));
findAllFeatures(false);
{
if (visibleNew)
{
- if (av.featuresDisplayed != null)
+ if (av.getFeaturesDisplayed() != null)
{
- av.featuresDisplayed.clear();
+ av.getFeaturesDisplayed().clear();
}
else
{
- av.featuresDisplayed = new Hashtable();
+ av.setFeaturesDisplayed(new Hashtable());
}
}
if (data == null)
// interface object
if (((Boolean) data[i][2]).booleanValue())
{
- av.featuresDisplayed.put(type, new Integer(getColour(type)
+ av.getFeaturesDisplayed().put(type, new Integer(getColour(type)
.getRGB()));
}
dassourceBrowser = new DasSourceBrowser(this);
dasSettingsPane.add(dassourceBrowser, BorderLayout.CENTER);
- if (af.getViewport().featuresDisplayed == null
+ if (af.getViewport().getFeaturesDisplayed() == null
|| fr.renderOrder == null)
{
fr.findAllFeatures(true); // display everything!
data[dataIndex][0] = type;
data[dataIndex][1] = fr.getFeatureStyle(type);
data[dataIndex][2] = new Boolean(
- af.getViewport().featuresDisplayed.containsKey(type));
+ af.getViewport().getFeaturesDisplayed().containsKey(type));
dataIndex++;
visibleChecks.removeElement(type);
}
System.arraycopy(fr.renderOrder, 0, typ, 0, typ.length);
for (int i = 0; i < typ.length; i++)
{
- if (af.viewport.featuresDisplayed.get(typ[i]) == null)
+ if (af.viewport.getFeaturesDisplayed().get(typ[i]) == null)
{
typ[i] = null;
}
view.setFollowHighlight(av.followHighlight);
view.setFollowSelection(av.followSelection);
view.setIgnoreGapsinConsensus(av.getIgnoreGapsConsensus());
- if (av.featuresDisplayed != null)
+ if (av.getFeaturesDisplayed() != null)
{
jalview.schemabinding.version2.FeatureSettings fs = new jalview.schemabinding.version2.FeatureSettings();
.getColour(renderOrder[ro]).getRGB());
}
- setting.setDisplay(av.featuresDisplayed
+ setting.setDisplay(av.getFeaturesDisplayed()
.containsKey(renderOrder[ro]));
float rorder = ap.seqPanel.seqCanvas.getFeatureRenderer()
.getOrder(renderOrder[ro]);
// recover featre settings
if (jms.getFeatureSettings() != null)
{
- af.viewport.featuresDisplayed = new Hashtable();
+ af.viewport.setFeaturesDisplayed(new Hashtable());
String[] renderOrder = new String[jms.getFeatureSettings()
.getSettingCount()];
for (int fs = 0; fs < jms.getFeatureSettings().getSettingCount(); fs++)
}
if (setting.getDisplay())
{
- af.viewport.featuresDisplayed.put(setting.getType(), new Integer(
+ af.viewport.getFeaturesDisplayed().put(setting.getType(), new Integer(
setting.getColour()));
}
}
if (jms.getFeatureSettings() != null)
{
- af.viewport.featuresDisplayed = new Hashtable();
+ af.viewport.setFeaturesDisplayed(new Hashtable());
String[] renderOrder = new String[jms.getFeatureSettings()
.getSettingCount()];
for (int fs = 0; fs < jms.getFeatureSettings().getSettingCount(); fs++)
if (setting.getDisplay())
{
- af.viewport.featuresDisplayed.put(setting.getType(), new Integer(
+ af.viewport.getFeaturesDisplayed().put(setting.getType(), new Integer(
setting.getColour()));
}
}
*/
package jalview.gui;
-import java.util.*;
-import java.util.List;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import jalview.commands.*;
-import jalview.datamodel.*;
+import jalview.commands.EditCommand;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
import jalview.io.SequenceAnnotationReport;
-import jalview.schemes.*;
-import jalview.structure.*;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.SelectionListener;
+import jalview.structure.SelectionSource;
+import jalview.structure.SequenceListener;
+import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.ToolTipManager;
+
/**
* DOCUMENT ME!
*
{
for (int i = 0; i < features.length; i++)
{
- if (av.featuresDisplayed == null
- || !av.featuresDisplayed.containsKey(features[i].getType()))
+ if (av.getFeaturesDisplayed() == null
+ || !av.getFeaturesDisplayed().containsKey(
+ features[i].getType()))
{
continue;
}
.containsKey(features[i].featureGroup)
&& !((Boolean) seqCanvas.fr.featureGroups
.get(features[i].featureGroup)).booleanValue())
+ {
continue;
+ }
if ((features[i].getBegin() <= res)
&& (features[i].getEnd() >= res))
pos = setStatusMessage(sequence, res, seq);
if (ssm != null && pos > -1)
+ {
mouseOverSequence(sequence, res, pos);
+ }
tooltipText.setLength(6); // Cuts the buffer back to <html>
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.exceptions.NoFileSelectedException;
import jalview.gui.AlignViewport;
import jalview.gui.AlignmentPanel;
import jalview.gui.FeatureRenderer;
-import jalview.gui.SequenceRenderer;
import jalview.json.binding.v1.BioJsAlignmentPojo;
import jalview.json.binding.v1.BioJsFeaturePojo;
import jalview.json.binding.v1.BioJsSeqPojo;
import java.io.PrintWriter;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Hashtable;
import com.json.JSONException;
private FeatureRenderer fr;
- public BioJsHTMLOutput(AlignmentPanel ap, SequenceRenderer sr,
+ private String globalColorScheme;
+
+ private Hashtable displayedFeatures;
+
+ private String jalviewVersion;
+
+ private String webStartLaunchServletUrl = "http://www.jalview.org/services/launchApp";
+
+ public BioJsHTMLOutput(AlignmentPanel ap,
FeatureRenderer fr1)
{
- this.av = ap.av;
- this.fr = new FeatureRenderer(ap);
+
+ jalviewVersion = jalview.bin.Cache.getProperty("VERSION");
+ webStartLaunchServletUrl = jalview.bin.Cache.getDefault(
+ "www.jalview.org", "http://www.jalview.org")
+ + "/services/launchApp";
+ if (ap != null)
+ {
+ this.av = ap.av;
+ this.globalColorScheme = ColourSchemeProperty.getColourName(av
+ .getGlobalColourScheme());
+ this.fr = new FeatureRenderer(ap);
fr.transferSettings(fr1);
+ displayedFeatures = av.getFeaturesDisplayed();
- exportAsBioJsHtml();
+ exportJalviewAlignmentAsBioJsHtmlFile();
+ }
}
- private void exportAsBioJsHtml()
+ private void exportJalviewAlignmentAsBioJsHtmlFile()
{
try
{
- JalviewFileChooser jvFileChooser = getJalviewFileChooserOption();
- int fileChooserOpt = jvFileChooser.showSaveDialog(null);
- if (fileChooserOpt == JalviewFileChooser.APPROVE_OPTION)
- {
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", jvFileChooser
- .getSelectedFile().getParent());
- String selectedFile = jvFileChooser.getSelectedFile().getPath();
- String generartedBioJs = generateBioJsAlignmentData(av
- .getAlignment());
- PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
- selectedFile));
- out.print(generartedBioJs);
- out.close();
- jalview.util.BrowserLauncher.openURL("file:///" + selectedFile);
- }
- } catch (Exception ex)
+ String outputFile = getOutputFile();
+ String jalviewAlignmentJson = getJalviewAlignmentAsJsonString(av
+ .getAlignment());
+ String bioJSTemplateString = getBioJsTemplateAsString(this);
+ String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
+ .replaceAll(
+"#sequenceData#", jalviewAlignmentJson)
+ .toString();
+
+ PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
+ outputFile));
+ out.print(generatedBioJsWithJalviewAlignmentAsJson);
+ out.flush();
+ out.close();
+ jalview.util.BrowserLauncher.openURL("file:///" + outputFile);
+ } catch (NoFileSelectedException ex)
+ {
+ // do noting if no file was selected
+ } catch (Exception e)
{
- ex.printStackTrace();
+ e.printStackTrace();
}
}
- private JalviewFileChooser getJalviewFileChooserOption()
+ public String getOutputFile() throws NoFileSelectedException
{
- JalviewFileChooser chooser = new JalviewFileChooser(
+ String selectedFile = null;
+ JalviewFileChooser jvFileChooser = new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
{ "html" }, new String[]
{ "HTML files" }, "HTML files");
- chooser.setFileView(new JalviewFileView());
+ jvFileChooser.setFileView(new JalviewFileView());
// TODO uncomment when supported by MassageManager
- chooser.setDialogTitle(MessageManager
+ jvFileChooser.setDialogTitle(MessageManager
.getString("label.save_as_biojs_html"));
- chooser.setDialogTitle("save as BioJs HTML");
- chooser.setToolTipText(MessageManager.getString("action.save"));
+ jvFileChooser.setDialogTitle("save as BioJs HTML");
+ jvFileChooser.setToolTipText(MessageManager.getString("action.save"));
+
+ int fileChooserOpt = jvFileChooser.showSaveDialog(null);
+ if (fileChooserOpt == JalviewFileChooser.APPROVE_OPTION)
+ {
+ jalview.bin.Cache.setProperty("LAST_DIRECTORY", jvFileChooser
+ .getSelectedFile().getParent());
+ selectedFile = jvFileChooser.getSelectedFile().getPath();
+ }
+ else
+ {
+ throw new NoFileSelectedException("No file was selected.");
+ }
- return chooser;
+ return selectedFile;
}
- private String generateBioJsAlignmentData(AlignmentI alignment)
+ public String getJalviewAlignmentAsJsonString(AlignmentI alignment)
throws IOException, JSONException
{
BioJsAlignmentPojo bjsAlignment = new BioJsAlignmentPojo();
- bjsAlignment.setGlobalColorScheme(ColourSchemeProperty.getColourName(av
- .getGlobalColourScheme()));
- // av.setGlobalColourScheme(cs);
+ bjsAlignment.setGlobalColorScheme(getGlobalColorScheme());
+ bjsAlignment.setJalviewVersion(jalviewVersion);
+ bjsAlignment.setWebStartUrl(webStartLaunchServletUrl);
+
int count = 0;
for (SequenceI seq : alignment.getSequences())
{
StringBuilder name = new StringBuilder();
name.append(seq.getName()).append("/").append(seq.getStart())
.append("-").append(seq.getEnd());
- // BioJsSeqPojo seqPojo = new BioJsSeqPojo(seq.getStart(), seq.getEnd(),
- // String.valueOf(++count),
- // name.toString(), seq.getSequenceAsString());
- //
+
BioJsSeqPojo seqPojo = new BioJsSeqPojo();
seqPojo.setId(String.valueOf(++count));
seqPojo.setEnd(seq.getEnd());
.getSequenceFeatures();
if (seqFeatures != null)
{
-
ArrayList<BioJsFeaturePojo> bjsSeqFeatures = new ArrayList<BioJsFeaturePojo>();
for (SequenceFeature sf : seqFeatures)
{
-
- String featureColour = jalview.util.Format.getHexString(fr
- .getColour(sf));
- BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo();
- bjsFeature.setFillColor(featureColour);
- bjsFeature.setXstart(sf.getBegin());
- bjsFeature.setXend(sf.getEnd());
- bjsFeature.setText(sf.getType());
-
- bjsSeqFeatures.add(bjsFeature);
-
+ if (displayedFeatures != null
+ && displayedFeatures.get(sf.getType()) != null)
+ {
+ String featureColour = jalview.util.Format.getHexString(fr
+ .getColour(sf));
+ BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo();
+ bjsFeature.setFillColor(featureColour);
+ bjsFeature.setXstart(seq.findIndex(sf.getBegin()) - 1);
+ bjsFeature.setXend(seq.findIndex(sf.getEnd()));
+ bjsFeature.setText(sf.getType());
+ bjsSeqFeatures.add(bjsFeature);
+ }
}
-
seqPojo.setFeatures(bjsSeqFeatures);
}
bjsAlignment.getSeqs().add(seqPojo);
}
- String jalviewData = new com.json.JSONObject(bjsAlignment).toString()
+ return new com.json.JSONObject(bjsAlignment).toString()
.replaceAll("xstart", "xStart").replaceAll("xend", "xEnd");
- // String bioJSTemplate = new String(
- // java.nio.file.Files.readAllBytes(java.nio.file.Paths
- // .get("resources/templates/BioJSTemplate.txt")));
- String bioJSTemplate = getBioJsTemplateAsString(this);
-
- return bioJSTemplate.replaceAll("#sequenceData#", jalviewData)
- .replaceAll(
- "#jalview_logo#",
- alignment.getClass()
- .getResource("/images/Jalview_Logo.png")
- .toString());
}
public static String getBioJsTemplateAsString(Object currentObj)
}
}
}
-
return sb.toString();
}
+ public String getGlobalColorScheme()
+ {
+ return globalColorScheme;
+ }
+
+ public void setGlobalColorScheme(String globalColorScheme)
+ {
+ this.globalColorScheme = globalColorScheme;
+ }
+
}
if (jsonSeqFeatures != null)
{
seqFeatures = new SequenceFeature[jsonSeqFeatures.size()];
- for (Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
+ for (@SuppressWarnings("unchecked")
+ Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
.hasNext();)
{
Long end = (Long) jsonFeature.get("xEnd");
String type = (String) jsonFeature.get("text");
- String color = (String) jsonFeature.get("fillColor");
+ // String color = (String) jsonFeature.get("fillColor");
sequenceFeature.setBegin(begin.intValue());
sequenceFeature.setEnd(end.intValue());
break;
}
- if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+ // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+ if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
{
reply = "HTML";
break;
}
- if ((data.indexOf("<") > -1))
+ if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>"))
{
reply = "RNAML";
public class BioJsAlignmentPojo
{
private String globalColorScheme = "none";
+
+ private String jalviewVersion;
+
+ private String webStartUrl;
private ArrayList<BioJsSeqPojo> seqs = new ArrayList<BioJsSeqPojo>();
public BioJsAlignmentPojo()
}
+ public String getJalviewVersion()
+ {
+ return jalviewVersion;
+ }
+
+ public void setJalviewVersion(String jalviewVersion)
+ {
+ this.jalviewVersion = jalviewVersion;
+ }
+
+ public String getWebStartUrl()
+ {
+ return webStartUrl;
+ }
+
+ public void setWebStartUrl(String webStartUrl)
+ {
+ this.webStartUrl = webStartUrl;
+ }
+
public enum JalviewBioJsColorSchemeMapper
{
USER_DEFINED("User Defined", "user defined", null), NONE("None", "foo",
--- /dev/null
+package jalview.io;
+
+import jalview.datamodel.Alignment;
+import jalview.datamodel.Sequence;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import com.json.JSONException;
+
+public class BioJsHTMLOutputTest
+{
+
+
+ @Test
+ public void getJalviewAlignmentAsJsonString()
+ {
+ BioJsHTMLOutput bioJsHtmlOuput = new BioJsHTMLOutput(null, null);
+ bioJsHtmlOuput.setGlobalColorScheme("Zappo");
+
+ Sequence[] seqs = new Sequence[1];
+ Sequence seq = new Sequence("name", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1, 26);
+ // SequenceFeature seqFeature = new SequenceFeature("type", "desc",
+ // "status", 1, 5, "jalview");
+ // seq.addSequenceFeature(seqFeature);
+ seq.setDatasetSequence(seq);
+ seqs[0] = seq;
+
+ Alignment al = new Alignment(seqs);
+ try
+ {
+ String generatedJson = bioJsHtmlOuput
+ .getJalviewAlignmentAsJsonString(al);
+ assert (generatedJson
+ .equalsIgnoreCase("{\"globalColorScheme\":\"zappo\",\"seqs\":[{\"id\":\"1\",\"start\":1,\"name\":\"name/1-26\",\"features\":[],\"seq\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"end\":26}]}"));
+ System.out.println("Output : " + generatedJson);
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ } catch (JSONException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+}
--- /dev/null
+package jalview.io;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class HtmlFileTest
+{
+
+ @Test
+ public void test()
+ {
+ fail("Not yet implemented");
+ }
+
+}