Merge branch 'develop' into developtomchmmer
[jalview.git] / src / jalview / gui / AlignViewport.java
index bc668fd..847084d 100644 (file)
@@ -92,6 +92,12 @@ public class AlignViewport extends AlignmentViewport
 
   private AnnotationColumnChooser annotationColumnSelectionState;
 
+  boolean validCharWidth;
+
+  public boolean followSelection = true;
+
+  private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>();
+
   /**
    * Creates a new AlignViewport object.
    * 
@@ -254,14 +260,18 @@ public class AlignViewport extends AlignmentViewport
 
     setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true);
 
-    alignment
-            .setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0));
+    AlignmentI al = getAlignment();
+
+    if (Cache.getDefault("NORMALISE_GAPS", true))
+    {
+      al.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0));
+    }
 
     // We must set conservation and consensus before setting colour,
     // as Blosum and Clustal require this to be done
-    if (hconsensus == null && !isDataset)
+    if (consensusProfiles == null && !isDataset)
     {
-      if (!alignment.isNucleotide())
+      if (!al.isNucleotide())
       {
         showConservation = Cache.getDefault("SHOW_CONSERVATION", true);
         showQuality = Cache.getDefault("SHOW_QUALITY", true);
@@ -273,13 +283,19 @@ public class AlignViewport extends AlignmentViewport
       showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", false);
       normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO",
               false);
+      // for now, use consensus options for Information till it gets its own
+      setShowHMMSequenceLogo(showSequenceLogo);
+      setNormaliseHMMSequenceLogo(normaliseSequenceLogo);
+      setShowInformationHistogram(showConsensusHistogram);
       showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
       showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
 
       showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true);
     }
     initAutoAnnotation();
-    String colourProperty = alignment.isNucleotide()
+    // initInformation();
+
+    String colourProperty = al.isNucleotide()
             ? Preferences.DEFAULT_COLOUR_NUC
             : Preferences.DEFAULT_COLOUR_PROT;
     String schemeName = Cache.getProperty(colourProperty);
@@ -302,13 +318,11 @@ public class AlignViewport extends AlignmentViewport
 
     if (residueShading != null)
     {
-      residueShading.setConsensus(hconsensus);
+      residueShading.setConsensus(consensusProfiles);
     }
     setColourAppliesToAllGroups(true);
   }
 
-  boolean validCharWidth;
-
   /**
    * {@inheritDoc}
    */
@@ -391,9 +405,9 @@ public class AlignViewport extends AlignmentViewport
     /*
      * replace mappings on our alignment
      */
-    if (alignment != null && align != null)
+    if (getAlignment() != null && align != null)
     {
-      alignment.setCodonFrames(align.getCodonFrames());
+      getAlignment().setCodonFrames(align.getCodonFrames());
     }
   }
 
@@ -444,7 +458,7 @@ public class AlignViewport extends AlignmentViewport
   }
 
   /**
-   * returns the visible column regions of the alignment
+   * Returns an iterator over the visible column regions of the alignment
    * 
    * @param selectedRegionOnly
    *          true to just return the contigs intersecting with the selected
@@ -462,10 +476,11 @@ public class AlignViewport extends AlignmentViewport
     }
     else
     {
-      end = alignment.getWidth();
+      end = getAlignment().getWidth();
     }
-    return (alignment.getHiddenColumns().getVisContigsIterator(start, end,
-            false));
+
+    return getAlignment().getHiddenColumns().getVisContigsIterator(start,
+            end, false);
   }
 
   /**
@@ -514,8 +529,6 @@ public class AlignViewport extends AlignmentViewport
     return false;
   }
 
-  public boolean followSelection = true;
-
   /**
    * @return true if view selection should always follow the selections
    *         broadcast by other selection sources
@@ -581,17 +594,6 @@ public class AlignViewport extends AlignmentViewport
             .getStructureSelectionManager(Desktop.instance);
   }
 
-  @Override
-  public boolean isNormaliseSequenceLogo()
-  {
-    return normaliseSequenceLogo;
-  }
-
-  public void setNormaliseSequenceLogo(boolean state)
-  {
-    normaliseSequenceLogo = state;
-  }
-
   /**
    * 
    * @return true if alignment characters should be displayed
@@ -602,8 +604,6 @@ public class AlignViewport extends AlignmentViewport
     return validCharWidth;
   }
 
-  private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<>();
-
   public AutoCalcSetting getCalcIdSettingsFor(String calcId)
   {
     return calcIdParams.get(calcId);