JAL-1760 JAL-1641 Serialisation of Hidden Seqs and Cols in JSON output. Added ability...
[jalview.git] / src / jalview / io / HtmlFile.java
index 75e99a6..3dd937d 100644 (file)
 
 package jalview.io;
 
-import jalview.api.AlignViewControllerGuiI;
-import jalview.schemes.ColourSchemeI;
-
 import java.io.IOException;
+import java.util.List;
 
 import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 
+import jalview.api.AlignViewControllerGuiI;
+import jalview.schemes.ColourSchemeI;
+
 public class HtmlFile extends AlignFile
 {
   public static final String FILE_EXT = "html";
@@ -40,6 +41,8 @@ public class HtmlFile extends AlignFile
 
   private boolean showSeqFeatures;
 
+  private List<int[]> hiddenColumns;
+
   public HtmlFile()
   {
     super();
@@ -72,25 +75,27 @@ public class HtmlFile extends AlignFile
       String alignmentJsonString = content.val();
 
       JSONFile jsonFile = new JSONFile().parse(alignmentJsonString);
-      seqs = jsonFile.getSeqs();
-      seqGroups = jsonFile.getSeqGroups();
-      annotations = jsonFile.getAnnotations();
-      showSeqFeatures = jsonFile.isShowSeqFeatures();
-      colourScheme = jsonFile.getColourScheme();
+      this.seqs = jsonFile.getSeqs();
+      this.seqGroups = jsonFile.getSeqGroups();
+      this.annotations = jsonFile.getAnnotations();
+      this.showSeqFeatures = jsonFile.isShowSeqFeatures();
+      this.colourScheme = jsonFile.getColourScheme();
+      this.hiddenColumns = jsonFile.getHiddenColumns();
     } catch (Exception e)
     {
       e.printStackTrace();
     }
   }
 
-  public void applySettingsToAlignFrame(AlignViewControllerGuiI af)
+  public void applySettingsToAlignmentView(AlignViewControllerGuiI avc)
   {
-    af.setShowSeqFeatures(isShowSeqFeatures());
-    af.changeColour(getColourScheme());
-    af.setMenusForViewport();
+    avc.setShowSeqFeatures(isShowSeqFeatures());
+    avc.changeColour(getColourScheme());
+    avc.setMenusForViewport();
+    avc.hideColumns(hiddenColumns);
+    avc.syncHiddenSequences();
   }
 
-
   @Override
   public String print()
   {