JAL-3285 small code changes to AnnotationRenderer not included in merge
[jalview.git] / src / jalview / renderer / AnnotationRenderer.java
index b3aea2c..f1f5fa8 100644 (file)
@@ -72,11 +72,14 @@ public class AnnotationRenderer
 
   private final boolean MAC = Platform.isAMac();
 
-  boolean av_renderHistogram = true, av_renderProfile = true,
-          av_normaliseProfile = false;
+  // todo remove these flags, read from group/viewport where needed
+  boolean av_renderHistogram = true;
 
-  boolean av_renderInformationHistogram = true, av_renderHMMProfile = true,
-          av_normaliseHMMProfile = false, av_infoHeight = false;
+  boolean av_renderProfile = true;
+
+  boolean av_normaliseProfile = false;
+
+  boolean av_infoHeight = false;
 
   ResidueShaderI profcolour = null;
 
@@ -170,7 +173,7 @@ public class AnnotationRenderer
   {
     g.setColor(STEM_COLOUR);
     int sCol = (lastSSX / charWidth)
-            + hiddenColumns.adjustForHiddenColumns(startRes);
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -237,7 +240,7 @@ public class AnnotationRenderer
 
     g.setColor(nonCanColor);
     int sCol = (lastSSX / charWidth)
-            + hiddenColumns.adjustForHiddenColumns(startRes);
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -333,9 +336,6 @@ public class AnnotationRenderer
     av_renderHistogram = av.isShowConsensusHistogram();
     av_renderProfile = av.isShowSequenceLogo();
     av_normaliseProfile = av.isNormaliseSequenceLogo();
-    av_renderInformationHistogram = av.isShowInformationHistogram();
-    av_renderHMMProfile = av.isShowHMMSequenceLogo();
-    av_normaliseHMMProfile = av.isNormaliseHMMSequenceLogo();
     profcolour = av.getResidueShading();
     if (profcolour == null || profcolour.getColourScheme() == null)
     {
@@ -388,13 +388,13 @@ public class AnnotationRenderer
                     .startsWith("cDNA Consensus")))
     {
       boolean forComplement = aa.label.startsWith("cDNA Consensus");
-      if (aa.groupRef != null && aa.groupRef.consensusData != null
+      if (aa.groupRef != null && aa.groupRef.getConsensusData() != null
               && aa.groupRef.isShowSequenceLogo())
       {
         // TODO? group consensus for cDNA complement
         return AAFrequency.extractProfile(
-                aa.groupRef.consensusData.get(column),
-                aa.groupRef.getIgnoreGapsConsensus());
+                aa.groupRef.getConsensusData().get(column),
+                aa.groupRef.isIgnoreGapsConsensus());
       }
       // TODO extend annotation row to enable dynamic and static profile data to
       // be stored
@@ -529,9 +529,18 @@ public class AnnotationRenderer
         }
         else if (InformationThread.HMM_CALC_ID.equals(row.getCalcId()))
         {
-          renderHistogram = av_renderInformationHistogram;
-          renderProfile = av_renderHMMProfile;
-          normaliseProfile = av_normaliseHMMProfile;
+          if (row.groupRef != null)
+          {
+            renderHistogram = row.groupRef.isShowInformationHistogram();
+            renderProfile = row.groupRef.isShowHMMSequenceLogo();
+            normaliseProfile = row.groupRef.isNormaliseHMMSequenceLogo();
+          }
+          else
+          {
+            renderHistogram = av.isShowInformationHistogram();
+            renderProfile = av.isShowHMMSequenceLogo();
+            normaliseProfile = av.isNormaliseHMMSequenceLogo();
+          }
         }
         else
         {
@@ -630,7 +639,7 @@ public class AnnotationRenderer
         {
           if (hasHiddenColumns)
           {
-            column = hiddenColumns.adjustForHiddenColumns(startRes + x);
+            column = hiddenColumns.visibleToAbsoluteColumn(startRes + x);
             if (column > row_annotations.length - 1)
             {
               break;
@@ -1178,7 +1187,7 @@ public class AnnotationRenderer
     g.setColor(HELIX_COLOUR);
 
     int sCol = (lastSSX / charWidth)
-            + hiddenColumns.adjustForHiddenColumns(startRes);
+            + hiddenColumns.visibleToAbsoluteColumn(startRes);
     int x1 = lastSSX;
     int x2 = (x * charWidth);
 
@@ -1278,7 +1287,7 @@ public class AnnotationRenderer
       column = sRes + x;
       if (hasHiddenColumns)
       {
-        column = hiddenColumns.adjustForHiddenColumns(column);
+        column = hiddenColumns.visibleToAbsoluteColumn(column);
       }
 
       if (column > aaMax)
@@ -1358,7 +1367,7 @@ public class AnnotationRenderer
       column = sRes + x;
       if (hasHiddenColumns)
       {
-        column = hiddenColumns.adjustForHiddenColumns(column);
+        column = hiddenColumns.visibleToAbsoluteColumn(column);
       }
 
       if (column > aaMax)