@Override
public void bioJSMenuItem_actionPerformed(ActionEvent e)
{
- new BioJsHTMLOutput(alignPanel,
+ BioJsHTMLOutput bjs = new BioJsHTMLOutput(alignPanel,
alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer());
+ bjs.exportJalviewAlignmentAsBioJsHtmlFile();
}
public void createImageMap(File file, String image)
{
if (source instanceof HtmlFile)
{
- ((HtmlFile) source).LoadAlignmentFeatures(af);
+ ((HtmlFile) source).applySettingsToAlignFrame(af);
}
else if (source instanceof JSONFile)
{
- ((JSONFile) source).LoadAlignmentFeatures(af);
+ ((JSONFile) source).applySettingsToAlignFrame(af);
}
this.av = ap.av;
av.setFeatureRenderer(new FeatureRenderer(ap));
}
- exportJalviewAlignmentAsBioJsHtmlFile();
+
}
- private void exportJalviewAlignmentAsBioJsHtmlFile()
+ public void exportJalviewAlignmentAsBioJsHtmlFile()
{
try
{
}
if (source instanceof HtmlFile)
{
- ((HtmlFile) source).LoadAlignmentFeatures(alignFrame);
+ ((HtmlFile) source).applySettingsToAlignFrame(alignFrame);
}
else if (source instanceof JSONFile)
{
- ((JSONFile) source).LoadAlignmentFeatures(alignFrame);
+ ((JSONFile) source).applySettingsToAlignFrame(alignFrame);
}
if (raiseGUI)
}
}
- public void LoadAlignmentFeatures(AlignFrame af)
+ public void applySettingsToAlignFrame(AlignFrame af)
{
af.setShowSeqFeatures(isShowSeqFeatures());
af.changeColour(getColourScheme());
public String print()
{
throw new UnsupportedOperationException(
- "Print method of HtmlFile not yet supported!");
+ "Print method of HtmlFile is not supported!");
}
public boolean isShowSeqFeatures()
{
private ColourSchemeI colourScheme;
- // private static boolean seqFeaturesEnabled;
-
private String jalviewVersion;
private String webStartLaunchServletUrl;
private FeaturesDisplayedI displayedFeatures;
- // private AlignViewportI viewport;
-
private FeatureRenderer fr;
private JSONExportSettings jsonExportSettings;
setDisplayedFeatures(getViewport().getFeaturesDisplayed());
showSeqFeatures = getViewport().isShowSequenceFeatures();
fr = getViewport().getFeatureRenderer();
- // setSeqFeaturesEnabled(viewport.isShowSequenceFeatures());
}
int count = 0;
Boolean showFeatures = Boolean.valueOf(jvSettingsJsonObj.get(
"showSeqFeatures").toString());
setColourScheme(getJalviewColorScheme(jsColourScheme));
- // JSONFile.setSeqFeaturesEnabled(showFeatures);
setShowSeqFeatures(showFeatures);
}
return jalviewColor;
}
- public void LoadAlignmentFeatures(AlignFrame af)
+ public void applySettingsToAlignFrame(AlignFrame af)
{
af.setShowSeqFeatures(isShowSeqFeatures());
af.changeColour(getColourScheme());
package jalview.io;
-import org.junit.Ignore;
+import java.io.IOException;
+
+import org.junit.Assert;
import org.junit.Test;
public class BioJsHTMLOutputTest
{
-
@Test
- @Ignore
public void getJalviewAlignmentAsJsonString()
{
- BioJsHTMLOutput bioJsHtmlOuput = new BioJsHTMLOutput(null, null);
-
+ BioJsHTMLOutput bioJsHtmlOutput = new BioJsHTMLOutput(null, null);
+ String bjsTemplate = null;
+ try
+ {
+ bjsTemplate = BioJsHTMLOutput
+ .getBioJsTemplateAsString(bioJsHtmlOutput);
+ // System.out.println(bjsTemplate);
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ Assert.assertNotNull(bjsTemplate);
}
-
}