--- /dev/null
+package jalview.api;
+
+public interface BuildDetailsI
+{
+ public String getBuildDate();
+
+ public String getVersion();
+
+ public String getInstallation();
+}
--- /dev/null
+package jalview.bin;
+
+import jalview.api.BuildDetailsI;
+
+
+public class BuildDetails implements BuildDetailsI
+{
+ private static String buildDate;
+
+ private static String version;
+
+ private static String installation;
+
+ public BuildDetails()
+ {
+
+ }
+
+ public BuildDetails(String version, String buildDate, String installation)
+ {
+ BuildDetails.version = version;
+ BuildDetails.buildDate = buildDate;
+ BuildDetails.installation = installation;
+ }
+
+ public String getBuildDate()
+ {
+ return buildDate;
+ }
+
+ public static void setBuilddate(String buildDate)
+ {
+ BuildDetails.buildDate = buildDate;
+ }
+
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public static void setVersion(String version)
+ {
+ BuildDetails.version = version;
+ }
+
+ public String getInstallation()
+ {
+ return installation;
+ }
+
+ public static void setInstallation(String installation)
+ {
+ BuildDetails.installation = installation;
+ }
+
+
+
+}
{
codeInstallation = " (" + codeInstallation + ")";
}
-
+ new BuildDetails(codeVersion, null, codeInstallation);
System.out
.println("Jalview Version: " + codeVersion + codeInstallation);
htmlSvg.append("<html>\n");
if (jsonData != null)
{
+ htmlSvg.append("<button onclick=\"javascipt:openJalviewUsingCurrentUrl();\">Launch in Jalview</button>");
htmlSvg.append("<input type=\"hidden\" name=\"seqData\" id=\"seqData\" value='"
+ jsonData + "'>");
}
+ "subCatContainer.scroll(\nfunction() {\n"
+ "subCatContainer.scrollTop($(this).scrollTop());\n});\n");
- htmlSvg.append("</script></hmtl>");
-
+ htmlSvg.append("</script>\n");
+
+ // javascript for launching file in Jalview
+
+ htmlSvg.append("<script language=\"JavaScript\">\n");
+ htmlSvg.append("function openJalviewUsingCurrentUrl(){\n");
+ htmlSvg.append(" var json = JSON.parse(document.getElementById(\"seqData\").value);\n");
+ htmlSvg.append(" var jalviewVersion = json['appSettings'].version;\n");
+ htmlSvg.append(" var url = json['appSettings'].webStartUrl;\n");
+ htmlSvg.append(" var myForm = document.createElement(\"form\");\n\n");
+ htmlSvg.append(" var heap = document.createElement(\"input\");\n");
+ htmlSvg.append(" heap.setAttribute(\"name\", \"jvm-max-heap\") ;\n");
+ htmlSvg.append(" heap.setAttribute(\"value\", \"2G\");\n\n");
+ htmlSvg.append(" var target = document.createElement(\"input\");\n");
+ htmlSvg.append(" target.setAttribute(\"name\", \"open\");\n");
+ htmlSvg.append(" target.setAttribute(\"value\", document.URL);\n\n");
+ htmlSvg.append(" var jvVersion = document.createElement(\"input\");\n");
+ htmlSvg.append(" jvVersion.setAttribute(\"name\", \"version\") ;\n");
+ htmlSvg.append(" jvVersion.setAttribute(\"value\", jalviewVersion);\n\n");
+ htmlSvg.append(" myForm.action = url;\n");
+ htmlSvg.append(" myForm.appendChild(heap);\n");
+ htmlSvg.append(" myForm.appendChild(target);\n");
+ htmlSvg.append(" myForm.appendChild(jvVersion);\n");
+ htmlSvg.append(" document.body.appendChild(myForm);\n");
+ htmlSvg.append(" myForm.submit() ;\n");
+ htmlSvg.append(" document.body.removeChild(myForm);\n");
+ htmlSvg.append("}\n");
+ htmlSvg.append("</script>\n");
+ htmlSvg.append("</hmtl>");
return htmlSvg.toString();
}
}
import jalview.api.ComplexAlignFile;
import jalview.api.FeatureRenderer;
import jalview.api.FeaturesDisplayedI;
+import jalview.bin.BuildDetails;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
{
private ColourSchemeI colourScheme;
- private String version = "2.9";
+ private static String version = new BuildDetails().getVersion();
- private String webstartUrl = "www.jalview.org/services/launchApp";
+ private String webstartUrl = "http://www.jalview.org/services/launchApp";
private String application = "Jalview";
jsonSeqPojo.setSeq(seq.getSequenceAsString());
jsonAlignmentPojo.getSeqs().add(jsonSeqPojo);
}
-
jsonAlignmentPojo.setGlobalColorScheme(globalColorScheme);
jsonAlignmentPojo.getAppSettings().put("application", application);
jsonAlignmentPojo.getAppSettings().put("version", version);