package jalview.io;
import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentExportData;
import jalview.exceptions.NoFileSelectedException;
import jalview.json.binding.v1.BioJSReleasePojo;
import jalview.json.binding.v1.BioJSRepositoryPojo;
try
{
String outputFile = getOutputFile();
- String jalviewAlignmentJson = JSONFile.getJSONData(ap);
+ // String jalviewAlignmentJson = JSONFile.getJSONData(ap);
+ AlignmentExportData exportData = jalview.gui.AlignFrame
+ .getAlignmentForExport(
+ JSONFile.FILE_DESC, ap.getAlignViewport());
+ if (exportData.getSettings().isCancelled())
+ {
+ return;
+ }
+ String jalviewAlignmentJson = new FormatAdapter(ap,
+ exportData.getSettings()).formatSequences(JSONFile.FILE_DESC,
+ exportData.getAlignment(), exportData.getOmitHidden(),
+ exportData.getStartEndPostions(), ap.getAlignViewport()
+ .getColumnSelection());
+
String bioJSTemplateString = getBioJsTemplateAsString();
String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
.replaceAll(
{ "HTML files" }, "HTML files");
jvFileChooser.setFileView(new JalviewFileView());
- // TODO uncomment when supported by MassageManager
jvFileChooser.setDialogTitle(MessageManager
.getString("label.save_as_biojs_html"));
jvFileChooser.setDialogTitle("save as BioJs HTML");
try
{
String gitRepoPkgJson = getURLContentAsString(BJS_TEMPLATE_GIT_REPO);
- BioJSRepositoryPojo release = new BioJSRepositoryPojo(
- gitRepoPkgJson);
- syncUpdates(BJS_TEMPLATES_LOCAL_DIRECTORY, release);
- refreshBioJSVersionsInfo(BJS_TEMPLATES_LOCAL_DIRECTORY);
+ if (gitRepoPkgJson != null)
+ {
+ BioJSRepositoryPojo release = new BioJSRepositoryPojo(
+ gitRepoPkgJson);
+ syncUpdates(BJS_TEMPLATES_LOCAL_DIRECTORY, release);
+ refreshBioJSVersionsInfo(BJS_TEMPLATES_LOCAL_DIRECTORY);
+ }
} catch (URISyntaxException e)
{
e.printStackTrace();