Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index 4aec9d2..345f08a 100644 (file)
@@ -89,7 +89,6 @@ public abstract class AlignmentViewport
 {
   public static final String PROPERTY_ALIGNMENT = "alignment";
   public static final String PROPERTY_SEQUENCE = "sequence";
-
   protected ViewportRanges ranges;
 
   protected ViewStyleI viewStyle = new ViewStyle();
@@ -618,6 +617,7 @@ public abstract class AlignmentViewport
    * alignment
    */
   protected boolean isDataset = false;
+
   
   public void setDataset(boolean b)
   {
@@ -656,11 +656,10 @@ public abstract class AlignmentViewport
   {
     autoCalculateStrucConsensus = b;
   }
-
-
   protected boolean ignoreGapsInConsensusCalculation = false;
 
   protected ResidueShaderI residueShading = new ResidueShader();
+
   
   @Override
   public void setGlobalColourScheme(ColourSchemeI cs)
@@ -735,6 +734,7 @@ public abstract class AlignmentViewport
   {
     return residueShading;
   }
+
   
   protected AlignmentAnnotation consensus;
 
@@ -769,6 +769,7 @@ public abstract class AlignmentViewport
   protected Hashtable<String, Object>[] hStrucConsensus = null;
 
   protected Conservation hconservation = null;
+
   
   @Override
   public void setConservation(Conservation cons)
@@ -954,7 +955,6 @@ public abstract class AlignmentViewport
       calculator.registerWorker(new InformationThread(this, ap));
     }
   }
-
   // --------START Structure Conservation
   public void updateStrucConsensus(final AlignmentViewPanel ap)
   {
@@ -1141,7 +1141,6 @@ public abstract class AlignmentViewport
     }
     this.hmmShowSequenceLogo = showHMMSequenceLogo;
   }
-
   /**
    * @param showConsensusHistogram
    *          the showConsensusHistogram to set
@@ -1449,7 +1448,6 @@ public abstract class AlignmentViewport
   {
     return infoLetterHeight;
   }
-
   // property change stuff
   // JBPNote Prolly only need this in the applet version.
   private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
@@ -1501,6 +1499,7 @@ public abstract class AlignmentViewport
     }
   }
 
+
   // common hide/show column stuff
 
   public void hideSelectedColumns()
@@ -1572,7 +1571,6 @@ public abstract class AlignmentViewport
     }
   }
 
-
   public void showSequence(int index)
   {
     int startSeq = ranges.getStartSeq();
@@ -1595,6 +1593,7 @@ public abstract class AlignmentViewport
       }
 
       ranges.setStartEndSeq(startSeq, endSeq + tmp.size());
+
       notifyAlignment();
       sendSelection();
     }
@@ -2080,7 +2079,6 @@ public abstract class AlignmentViewport
               MessageManager.getString("label.consensus_descr"),
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
       initConsensus(consensus);
-
       initGapCounts();
 
       initComplementConsensus();
@@ -3126,7 +3124,6 @@ public abstract class AlignmentViewport
     }
     return false;
   }
-
   @Override
   public void setCurrentTree(TreeModel tree)
   {
@@ -3253,6 +3250,24 @@ public abstract class AlignmentViewport
       codingComplement.setUpdateStructures(needToUpdateStructureViews);
     }
   }
+
+  @Override
+  public Iterator<int[]> getViewAsVisibleContigs(boolean selectedRegionOnly)
+  {
+    int start = 0;
+    int end = 0;
+    if (selectedRegionOnly && selectionGroup != null)
+    {
+      start = selectionGroup.getStartRes();
+      end = selectionGroup.getEndRes() + 1;
+    }
+    else
+    {
+      end = alignment.getWidth();
+    }
+    return (alignment.getHiddenColumns().getVisContigsIterator(start, end,
+            false));
+  }
   /**
    * Filters out sequences with an eValue higher than the specified value. The
    * filtered sequences are hidden or deleted. Sequences with no eValues are also