JAL-1753 statusPanel added (for ProgressBar); 'Fit to Window' menu
[jalview.git] / src / jalview / io / HtmlFile.java
index 7272830..75e99a6 100644 (file)
@@ -1,6 +1,27 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+
 package jalview.io;
 
-import jalview.gui.AlignFrame;
+import jalview.api.AlignViewControllerGuiI;
 import jalview.schemes.ColourSchemeI;
 
 import java.io.IOException;
@@ -15,7 +36,9 @@ public class HtmlFile extends AlignFile
 
   public static final String FILE_DESC = "HTML";
 
-  private ColourSchemeI cs;
+  private ColourSchemeI colourScheme;
+
+  private boolean showSeqFeatures;
 
   public HtmlFile()
   {
@@ -49,19 +72,21 @@ public class HtmlFile extends AlignFile
       String alignmentJsonString = content.val();
 
       JSONFile jsonFile = new JSONFile().parse(alignmentJsonString);
-      seqs = jsonFile.seqs;
-      seqGroups = jsonFile.seqGroups;
-      annotations = jsonFile.annotations;
+      seqs = jsonFile.getSeqs();
+      seqGroups = jsonFile.getSeqGroups();
+      annotations = jsonFile.getAnnotations();
+      showSeqFeatures = jsonFile.isShowSeqFeatures();
+      colourScheme = jsonFile.getColourScheme();
     } catch (Exception e)
     {
       e.printStackTrace();
     }
   }
 
-  public void LoadAlignmentFeatures(AlignFrame af)
+  public void applySettingsToAlignFrame(AlignViewControllerGuiI af)
   {
-    af.setShowSeqFeatures(JSONFile.isSeqFeaturesEnabled());
-    af.changeColour(JSONFile.getColourScheme());
+    af.setShowSeqFeatures(isShowSeqFeatures());
+    af.changeColour(getColourScheme());
     af.setMenusForViewport();
   }
 
@@ -70,7 +95,27 @@ public class HtmlFile extends AlignFile
   public String print()
   {
     throw new UnsupportedOperationException(
-            "Print method of HtmlFile not yet supported!");
+            "Print method of HtmlFile is not supported!");
+  }
+
+  public boolean isShowSeqFeatures()
+  {
+    return showSeqFeatures;
+  }
+
+  public void setShowSeqFeatures(boolean showSeqFeatures)
+  {
+    this.showSeqFeatures = showSeqFeatures;
+  }
+
+  public ColourSchemeI getColourScheme()
+  {
+    return colourScheme;
+  }
+
+  public void setColourScheme(ColourSchemeI colourScheme)
+  {
+    this.colourScheme = colourScheme;
   }
 
 }