3 import jalview.gui.AlignFrame;
4 import jalview.schemes.ColourSchemeI;
6 import java.io.IOException;
8 import org.jsoup.Jsoup;
9 import org.jsoup.nodes.Document;
10 import org.jsoup.nodes.Element;
12 public class HtmlFile extends AlignFile
14 public static final String FILE_EXT = "html";
16 public static final String FILE_DESC = "HTML";
18 private ColourSchemeI colourScheme;
20 private boolean showSeqFeatures;
27 public HtmlFile(FileParse source) throws IOException
32 public HtmlFile(String inFile, String type) throws IOException
38 public void parse() throws IOException
42 StringBuilder htmlData = new StringBuilder();
44 while ((currentLine = nextLine()) != null)
46 htmlData.append(currentLine);
49 Document doc = Jsoup.parse(htmlData.toString());
50 Element content = doc.getElementById("seqData");
51 String alignmentJsonString = content.val();
53 JSONFile jsonFile = new JSONFile().parse(alignmentJsonString);
55 seqGroups = jsonFile.seqGroups;
56 annotations = jsonFile.annotations;
57 showSeqFeatures = jsonFile.isShowSeqFeatures();
58 colourScheme = jsonFile.getColourScheme();
65 public void applySettingsToAlignFrame(AlignFrame af)
67 af.setShowSeqFeatures(isShowSeqFeatures());
68 af.changeColour(getColourScheme());
69 af.setMenusForViewport();
76 throw new UnsupportedOperationException(
77 "Print method of HtmlFile is not supported!");
80 public boolean isShowSeqFeatures()
82 return showSeqFeatures;
85 public void setShowSeqFeatures(boolean showSeqFeatures)
87 this.showSeqFeatures = showSeqFeatures;
90 public ColourSchemeI getColourScheme()
95 public void setColourScheme(ColourSchemeI colourScheme)
97 this.colourScheme = colourScheme;